T
Trevor L.
I have set up a batch file to do backups from C: to F: (external disk)
One line in the file is:
C:\Windows\System32\Xcopy.exe "C:\Documents and Settings\Trevor\My
Documents\*.*" "F:\0 C_Backup\Documents and Settings\Trevor\My Documents" /D
/E /C /I /Q /H /R /K /Y
(This is all on one line)
But I want to exclude certain directories, which are rather volatile, or
some which are quite non-volatile.
The help command xcopy /? says
/EXCLUDE:file1[+file2][+file3]...
Specifies a list of files containing strings. Each string
should be in a separate line in the files. When any of the
strings match any part of the absolute path of the file to be
copied, that file will be excluded from being copied. For
example, specifying a string like \obj\ or .obj will exclude
all files underneath the directory obj or all files with the
.obj extension respectively.
How, for example, do I exclude My Received Files ?
Do I use /EXCLUDE:\"My Received Files"\ ?
My queries are:
Where do I put the \ delimiters to indicate a directory ?
Where do I put the " quotes to enclose a directory with blank spaces ?
And how do I also exclude, e.g. My Music which is not very volatile
Is it /EXCLUDE:\"My Received Files"\+\"My Music"\ ?
Or are all of these incorrect?
If so, what is the correct syntax?
One possibility seems to be that I set up a file say exclude.txt, containing
\"My Received Files"\
\"My Music"\
and use
/EXCLUDE:exclude.txt
But I am still not sure where to put the \ and "
One line in the file is:
C:\Windows\System32\Xcopy.exe "C:\Documents and Settings\Trevor\My
Documents\*.*" "F:\0 C_Backup\Documents and Settings\Trevor\My Documents" /D
/E /C /I /Q /H /R /K /Y
(This is all on one line)
But I want to exclude certain directories, which are rather volatile, or
some which are quite non-volatile.
The help command xcopy /? says
/EXCLUDE:file1[+file2][+file3]...
Specifies a list of files containing strings. Each string
should be in a separate line in the files. When any of the
strings match any part of the absolute path of the file to be
copied, that file will be excluded from being copied. For
example, specifying a string like \obj\ or .obj will exclude
all files underneath the directory obj or all files with the
.obj extension respectively.
How, for example, do I exclude My Received Files ?
Do I use /EXCLUDE:\"My Received Files"\ ?
My queries are:
Where do I put the \ delimiters to indicate a directory ?
Where do I put the " quotes to enclose a directory with blank spaces ?
And how do I also exclude, e.g. My Music which is not very volatile
Is it /EXCLUDE:\"My Received Files"\+\"My Music"\ ?
Or are all of these incorrect?
If so, what is the correct syntax?
One possibility seems to be that I set up a file say exclude.txt, containing
\"My Received Files"\
\"My Music"\
and use
/EXCLUDE:exclude.txt
But I am still not sure where to put the \ and "