Art*_*hor 2 batch-file robocopy
我有这个代码,感谢这个论坛:
@echo on
set source="R:\Contracts\"
set destination="R:\Contracts\Sites"
::Not sure if this is needed
::It guarantees you have a canonical path (standard form)
for %%F in (%destination%) do set destination="%%~fF"
for /r %source% %%F in (.) do if "%%~fF" neq %destination% ROBOCOPY "%%F" %destination% *.srt *.pdf *.mp4 *.jpg /COPYALL /R:0
Pause
Run Code Online (Sandbox Code Playgroud)
如果文件存在,我不确定上面的代码是否具有"SKIP命令",如果文件大小相同,我不确定是否跳过.
400个文件似乎需要很长时间.我想尽快将它改为40000文件.
谢谢.
是否要排除相同大小的文件或未更改的文件?如果是后者,请使用/XORoboCopy中的开关来排除比正在复制的文件更旧的文件.
RoboCopy "%%F" %destination% *.srt *.pdf *.mp4 *.jpg /COPYALL /XO /R:0
Run Code Online (Sandbox Code Playgroud)