我对robocopy有问题。我想将其用于备份系统光盘,并且要排除一些系统文件夹。但是它仍在尝试复制其中一些文件夹。
我的批处理文件是这样的:

robocopy c:\ l:\C\ /r:1 /w:1 /mir /dcopy:T /xjd /xjf /xj /copy:DT /log+: l:\RobocopyLogC.txt /xf "desktop.ini" /xd "$Recycle.Bin" /xd Config.Msi /xd MSOCache/xd Recovery /xd "System Volume Information" /xd Windows /xd "Program Files\Common Files" /xd "Program Files\Internet Explorer" /xd "Program Files\Reference Assemblies" /xd "Program Files\Uninstall Information" /xd "Program Files\Microsoft Analysis Services" /xd "Program Files\Microsoft Mouse and Keyboard Center" /xd "Program Files\Microsoft Office" /xd "Program Files\Microsoft Silverlight" /xd "Program Files\MSBuild" /xd "Program Files\Windows Defender" /xd "Program Files\Windows Journal" /xd "Program Files\Windows Mail" /xd "Program Files\Windows Media Player" /xd "Program Files\Windows Multimedia Platform" /xd "Program Files\Windows NT" /xd "Program Files\Windows Photo Viewer" /xd "Program Files\Windows Portable Devices" /xd "Program Files\Windows Sidebar" /xd "Program Files\WindowsApps" /xd "Program Files\WindowsPowerShell" /xd "Program Files (x86)\Common Files" /xd "Program Files (x86)\InstallShield Installation Information" /xd "Program Files (x86)\Internet Explorer" /xd "Program Files (x86)\Microsoft Analysis Services" /xd "Program Files (x86)\Microsoft Office" /xd "Program Files (x86)\Microsoft Silverlight" /xd "Program Files (x86)\Microsoft.NET" /xd "Program Files (x86)\MSBuild" /xd "Program Files (x86)\Reference Assemblies" /xd "Program Files (x86)\Temp" /xd "Program Files (x86)\Windows Defender" /xd "Program Files (x86)\Windows Mail" /xd "Program Files (x86)\Windows Media Player" /xd "Program Files (x86)\Windows Multimedia Platform" /xd "Program Files (x86)\Windows NT" /xd "Program Files (x86)\Windows Photo Viewer" /xd "Program Files (x86)\Windows Portable Devices" /xd "Program Files (x86)\WindowsPowerShell" /xd "Program Files (x86)\Windows Sidebar" /xd ProgramData\Microsoft /xd "ProgramData\Microsoft Help" /xd "ProgramData\Package Cache" /xd Users\Public /xd Users\Default /xd Users\userName2 /xd Users\userName\AppData\LocalLow\Temp /xd Users\userName\AppData\Local\Temp


我尝试了很多事情,但没有任何帮助。你能帮助我吗?

最佳答案

不要使用多个/ xd!
只需将所有目录设置在第一个/ xd后面

... /xd "dir1" "dir2" "dir3" ...

关于robocopy - Robocopy-排除很多目录,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/24870973/

10-12 12:24