Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Robocopy question regarding exclude directory 1

Status
Not open for further replies.

Fino

IS-IT--Management
May 13, 2007
14
US
I created a robocopy script and wanted to exclude 2 folders from copying. The first is [highlight #FCE94F]AppData[/highlight] and the second is [highlight #FCE94F]OneDrive[/highlight]. I have tried to repeat the XD switch but that did not work (/XD AppData /XD OneDrive). I then tried the text below and that did not work. Does anyone know if it is possible to exclude two folders in one command? If yes, what is the correct context?
Thank you,
Dom

Robocopy "C:\Users\Dominic" "S:\TheBackup" /MIR /XA:SH /[highlight #FCE94F]XD AppData/OneDrive[/highlight] /XJD /R:5 /W:15 /MT:32 /V /NP /LOG:Backup.log
 
This is what it should look like:
robocopy.exe C:\Users\pinhead\ \\hp-probook\desktopdata /MIR /FFT /TEE /XA:SH /XJ /xJD /XJF /XD "c:\users\pinhead\documents\eudoraback" "c:\users\pinhead\documents\eudoraweek" "C:\Users\pinhead\Documents\Email" C:\Users\pinhead\AppData\ /ZB /R:1 /W:1 /LOG:"C:\laptopbackup.log"

XD only appears once. Folders are separated. The quotes are not really necessary. As you can see, I forget the quotes for one folder but it still excludes APPDATA. Name has been changed from actual customer.
 
Thank you. I see what you are saying.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top