1.

Solve : Xcopy in Batch File Only new files?

Answer»

I'm trying to xcopy from ONE pc to another both are XP. I CREATED a batch FILE to do the xcopy and it works fine. However, I would like to limit this to include only FILES that have been created in the last 4 days.

This is what I have and it works.

xcopy "x:\" "e:\" /s /e /y /c /z

I need help creating a variable for %date%-4 and passing it into my xcopy /d switch.

Batch files do not do date and time calculations unless you are prepared to write a BOATLOAD of IF statements.

Case in point:

Today = 11/04/2005

Subtract 4. What day do you reckon 11/00/2005 might be?



Discussion

No Comment Found