I have a rather simple copy and paste batch job. That checks for a more recent file and overwrites it.
I was trying to take a single COPY and copy it to a second directory.
In simple, this Batch is to replace Files on a System (Upgrade) But i would also like a copy of all files replaced in one folder. As my Xcopy is checking Datestamp prior to replacing. Then i caot use the Same command again to copy to an additional directory
(I only want replaced / more recent files in a additional directory)
xcopy "\DIR1eDIR2DIR3" C:ROotSystem /d /y /r
xcopy "\DIR1eDIR6DIR8" C:ROotSystem /d /y /r
xcopy "\DIR1eDIR5DIR6" C:ROotSystem /d /y /r
xcopy "\DIR1eDIR4DIR2" C:ROotSystem /d /y /r
::@pause
So only if the file is more recent, is it replaced. How can i use the files its replaced and put them into a Upgrade folder for example:
xcopy "\DIR1eDIR2DIR3" C:ROotSystem C:ROotSystemUpgradefile /d /y /r
i.e. C:ROotSystemUpgradefile would be the additional folder all files are copied to that where replaced in C:ROotSystem
Just incase: /d=(Date) /y=Overwrite file is more recent /r=Overwrite Read only
برچسب:
نویسنده: استخدام کار