On Thursday, 24 January 2019 22:49:41 UTC, JJ wrote:
That, as is, will not do; it will erase the old file %dest%, and
I want to copy only the few new files, leaving the many other old
ones untouched (especially as the destination might be a slow
device, and some files are vast). So I can use 'if not exist
dest create a dest first'.
I'd rather not use both XCOPY and XCOPY /D, but instead of
your redirected REM I could copy over an ancient (and perhaps
empty) file. DOS datestamps used a 16-bit unsigned integer
for days since 1980-01-01 = Day 0, but I see that imported
Touch32 in Win10 can go back to 1601-01-01. But XCOPY is
ancient, and might not like that. Going back to, say, 1981
should be safe.
H'mmm - I've used various ways to create a zero-length file
in the past, presumably because the obvious one did not then
work.
But (command line)
copy nul zzz > nul
touch32 zzz 1981 > nul
dir zzz
shows
1981-01-01 00:00 0 zzz
That looks promising.
P.S. I don't mind using an already-imported tool, Touch32; but
I don't want to import and learn another tool for this. Hence
- no RoboCopy.
Thanks.