I'm using the robocopy in batch files that automatic updating our softwares.
that is the command I'm currently use:
ROBOCOPY "%Source%" "%Destination%" /MIR /PURGE /E /NP /R:5 /LOG+:"%Destination%\Update.log" /TS /FP /TEE /XF "%Destination%\SettingsA.config" "%Destination%\SettingsB.config" "%Destination%\SettingsC.config" "%Destination%\Trace.log" "%Destination%\Error.log" "%Destination%\update.log" /XD "%Destination%\Logs"
That command exclude the config and log files, and it's works great.
The problem is that if the config files does not exist, I have to copy the default files from the source directory (%Source%\SettingsA.config
, %Source%\SettingsB.config
and %Source%\SettingsC.config
in that case)
Currently, if that config files will be exist on the source directory they will be overwritten on the destination directory.
Because the source directory is from a mapped network drive it will much better to perform it with a single robocopy command.
Is it possible?
robocopy
"%Source%" "%Destination%" /E /XC /XN /XO /XX …
? - aschipfl/XO
then? or reading the documentation after all? Typerobocopy /?
into a Command Prompt window and read the help, particularly theFile Selection Options
section… - aschipfl