If equal the file is skipped else it is XCOPY'd. The echo lines in the subroutine can be deleted.įor each file, the batchfile collects the filesize once in the source folder and then in the destination folder and compares them literally, using dir. You would need to adjust the XCOPY options to your needs. Rem compare file metadata of %1 in current dir and dir %2įor /f "tokens=3 usebackq" %%a in (`dir "%~1" ^| findstr /C:"%~1" ^|^| echo - `) do set saved=%%aįor /f "tokens=3 usebackq" %%a in (`dir "%~1" ^| findstr /C:"%~1"`) do set live=%%a :: copy files to TARGETDIR if different, modified date or size or nameįor %%f in (*.pst) do CALL :COPY_CHANGED %%f %TARGETDIR% This batchfile is clumsy but gets the job done: off At least XCOPY cannot, and neither can ROBOCOPY AFAIK. Copies files with the archive attribute set, and. This switch doesn't change the attribute. Copies files with the archive attribute set. Xcopy provides an excellent tool for backing up selected folders. Specifies the location and the name of new files. This is because the ownership of some files lies with your previous Windows machine.This actually is unbelievable that a tool for copying cannot "update" a target file. The following table describes the optional switches you can use with xcopy and xcop圓2: Specifies the file to copy.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |