i need to a .bat file to copy with xcopy command the files from a specific directory that are 90 days new. that means to take the todays date and take out 90 days of it and do not perform the copy.
开发者_StackOverflowhelp is needed,
thx
Use ROBOCOPY
not XCOPY
. It will do what you want very easily. Robocopy is installed on Windows 7 and is a free download for other versions.
ROBOCOPY /S /MAXAGE:90 P:\path\to\source Q:\path\to\dest
There are many other options, for minimum age, min and max size, attrributes, filtering by file and directory names, and so forth.
Also you can use the /L option to just list what it would have done, to check you have the other options right.
精彩评论