al4629740
asked on
Backup script avoid My Music
I want to backup all in Mydocument on everyone's computer, so I wrote the following batch file:
xcopy "%userprofile%\My Documents\*.*" "I:\Backup\" /c/f/h/d/y/s/e
How can I rewrite this to copy all in My Documents but avoid the folder 'My Music'
xcopy "%userprofile%\My Documents\*.*" "I:\Backup\" /c/f/h/d/y/s/e
How can I rewrite this to copy all in My Documents but avoid the folder 'My Music'
Sorry exclude list file should be in following format:
\My Music\
\My Videos\
\Any other folder\
\My Music\
\My Videos\
\Any other folder\
@ECHO \My Music\>ExcludeList.txt
xcopy "%userprofile%\My Documents\*.*" "I:\Backup\" /c/f/h/d/y/s/e /EXCLUDE:ExcludeList.txt
ASKER
Is this how I would do multiple folders?
@ECHO \My Music\>ExcludeList.txt
@ECHO \My Videos\>ExcludeList.txt
xcopy "%userprofile%\My Documents\*.*" "I:\Backup\" /c/f/h/d/y/s/e /EXCLUDE:ExcludeList.txt
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
So a third would look like this:
@ECHO \My Music\>ExcludeList.txt
@ECHO \My Videos\>>ExcludeList.txt
@ECHO \My Pictures\>>ExcludeList.txt
xcopy "%userprofile%\My Documents\*.*" "I:\Backup\" /c/f/h/d/y/s/e /EXCLUDE:ExcludeList.txt
Yes, exactly
Like:
Open in new window