Basically, in an automated batch file, I want to copy and rename a file if the destination file is missing or older. There are several variants, which do not quite work:
copy /Y c:\source\a.file c:\dest\b.file
- always copies, no /D option or something
xcopy /Y /D c:\source\a.file c:\dest\b.file
- if destination does not exist, tries to ask if the destination is a file or directory, creating havoc in the automated build.
robocopy /XO ...
- does not support renaming the file.
It seems Windows has not managed to replicate Unix "cp -u" in 20+ years, or am I overlooking something?