File Lists with EXCEPT command

#1
I'm not at all clear on this:

I want to copy all of Drive "C" to Drive "D", EXCEPT

C:\VirtualRoot
C:\Diskeeper
C:\Users\CWBillow\Documents\~ Finance


I want to set up a file list (Exceptions.txt) to ease in editing the exceptions.

Can I put all these folders in the same list? One line per each? If I cannot, then can I include multiple lists? And if so, would my command line look something like

except @C:\Exceptions.txt @C:\exceptions_2.txt copy /e /h /k /q /r /s /u /z c:\*.* D:\WINDOWSCOPY

(apologies for not tuning off wordwrap...couldn't seem to find out how)

?

Regards,
Chuck Billow
 
#2
| I'm not at all clear on this:
|
| I want to copy all of Drive "C" to Drive "D", EXCEPT
|
| C:\VirtualRoot
| C:\Diskeeper
| C:\Users\CWBillow\Documents\~ Finance
|
|
| I want to set up a file list (Exceptions.txt) to ease in editing the
| exceptions.
|
| Can I put all these folders in the same list? One line per each? If
| I cannot, then can I include multiple lists? And if so, would my
| command line look something like
|
| except @C:\Exceptions.txt @C:\exceptions_2.txt copy /e /h /k /q /r /s /u
/z c:\*.* D:\WINDOWSCOPY

Remember: EXCEPT works on the basis of temporarily setting the H attribute
of files, which your COPY /H option overrides! If you want to copy hidden
files, only COPY's exclusion range option /[!filelist directorylist] can be
used. Unfortunately the indirect file method is NOT available in exclusion
range specifications (any "@" symbol would be considered as part of a
filename). Read HELP topic "filexranges.htm" for details relevant to your
version of the command processor.
--
HTH, Steve
 
#3
| I'm not at all clear on this:
|
| I want to copy all of Drive "C" to Drive "D", EXCEPT
|
| C:\VirtualRoot
| C:\Diskeeper
| C:\Users\CWBillow\Documents\~ Finance
|
|
| I want to set up a file list (Exceptions.txt) to ease in editing the
| exceptions.
|
| Can I put all these folders in the same list? One line per each? If
| I cannot, then can I include multiple lists? And if so, would my
| command line look something like
|
| except @C:\Exceptions.txt @C:\exceptions_2.txt copy /e /h /k /q /r /s /u
/z c:\*.* D:\WINDOWSCOPY

Remember: EXCEPT works on the basis of temporarily setting the H attribute
of files, which your COPY /H option overrides! If you want to copy hidden
files, only COPY's exclusion range option /[!filelist directorylist] can be
used. Unfortunately the indirect file method is NOT available in exclusion
range specifications (any "@" symbol would be considered as part of a
filename). Read HELP topic "filexranges.htm" for details relevant to your
version of the command processor.
--
HTH, Steve
I'll give it a look. Thanks Steve.

Regards,
Chuck
 
#4
| I'm not at all clear on this:
|
| I want to copy all of Drive "C" to Drive "D", EXCEPT
|
| C:\VirtualRoot
| C:\Diskeeper
| C:\Users\CWBillow\Documents\~ Finance
|
|
| I want to set up a file list (Exceptions.txt) to ease in editing the
| exceptions.
|
| Can I put all these folders in the same list? One line per each? If
| I cannot, then can I include multiple lists? And if so, would my
| command line look something like
|
| except @C:\Exceptions.txt @C:\exceptions_2.txt copy /e /h /k /q /r /s /u
/z c:\*.* D:\WINDOWSCOPY

Remember: EXCEPT works on the basis of temporarily setting the H attribute
of files, which your COPY /H option overrides! If you want to copy hidden
files, only COPY's exclusion range option /[!filelist directorylist] can be
used. Unfortunately the indirect file method is NOT available in exclusion
range specifications (any "@" symbol would be considered as part of a
filename). Read HELP topic "filexranges.htm" for details relevant to your
version of the command processor.
--
HTH, Steve
Well Steve, now I'm totally confused! I read (and marked) the section of help, but it didn't seem clear to me at all.

How would I set up the command if I wanted to copy *all* the files on a given drive to another drive, except, say, three specific folders and two specific files -- all in different locations?

If I can't use the /h switch, then how do I get at the hidden files to copy them? And exclude the ones I refer to?

CB
 
#5
| How would I set up the command if I wanted to copy *all* the files
| on a given drive to another drive, except, say, three specific
| folders and two specific files -- all in different locations?
|
| If I can't use the /h switch, then how do I get at the hidden files
| to copy them? And exclude the ones I refer to?

If the files you do not want copied have name that are unique for the whole
drive, except possibly duplicated in directories not to be copied, thus (all
on one line, or use the EscapeChar at the end of each physical line to
continue it):

copy /[! C:\VirtualRoot\ C:\Diskeeper\ "C:\Users\CWBillow\Documents\~
Finance\" file1 file2 ...] /e /h /k /q /r /s /u /z c:\*.* D:\WINDOWSCOPY

However, if there is a file named file1 in a directory that is to be copied
it won't get copied. If that's the case, you could emulate the "except"
command manually, using the S (system) attribute, performing the following
steps:

1/ clear the system attribute of all files and directories:
attrib /a:s /d /e /s /q -s *
2/ set the S attribute of all files and directories not to be copied
attrib /d /e /s /q +S C:\VirtualRoot\* C:\Diskeeper\*
"C:\Users\CWBillow\Documents\~ Finance\*" file1_with_path file2_with_path
...
3/ copy all files without the S attribute:
copy /e /h /k /q /r /s /u /z c:\ D:\WINDOWSCOPY
4/ remove the S attribute:
attrib /a:s /d /e /s /q -s *

The only problem with this method is that files and directories which
originally had the S attribute will no longer have it, though most files
with the S attribute also have the H attribute, which has not been changed.
If the S attribute must be restored, Step 1 should be executed without the
/Q (quiet) option, its output redirected to a file, and Step 5 added using
the indirect file approach to restore the S attributes.
If time and target diskspace allow, it may be simpler to just copy all
files, and delete the ones that are not to be copied. This can be done only
if none of the files that are not to be copied exist on the target before
you start.
--
HTH, Steve
 
#6
| How would I set up the command if I wanted to copy *all* the files
| on a given drive to another drive, except, say, three specific
| folders and two specific files -- all in different locations?
|
| If I can't use the /h switch, then how do I get at the hidden files
| to copy them? And exclude the ones I refer to?

If the files you do not want copied have name that are unique for the whole
drive, except possibly duplicated in directories not to be copied, thus (all
on one line, or use the EscapeChar at the end of each physical line to
continue it):

copy /[! C:\VirtualRoot\ C:\Diskeeper\ "C:\Users\CWBillow\Documents\~
Finance\" file1 file2 ...] /e /h /k /q /r /s /u /z c:\*.* D:\WINDOWSCOPY

However, if there is a file named file1 in a directory that is to be copied
it won't get copied. If that's the case, you could emulate the "except"
command manually, using the S (system) attribute, performing the following
steps:

1/ clear the system attribute of all files and directories:
attrib /a:s /d /e /s /q -s *
2/ set the S attribute of all files and directories not to be copied
attrib /d /e /s /q +S C:\VirtualRoot\* C:\Diskeeper\*
"C:\Users\CWBillow\Documents\~ Finance\*" file1_with_path file2_with_path
...
3/ copy all files without the S attribute:
copy /e /h /k /q /r /s /u /z c:\ D:\WINDOWSCOPY
4/ remove the S attribute:
attrib /a:s /d /e /s /q -s *

The only problem with this method is that files and directories which
originally had the S attribute will no longer have it, though most files
with the S attribute also have the H attribute, which has not been changed.
If the S attribute must be restored, Step 1 should be executed without the
/Q (quiet) option, its output redirected to a file, and Step 5 added using
the indirect file approach to restore the S attributes.
If time and target diskspace allow, it may be simpler to just copy all
files, and delete the ones that are not to be copied. This can be done only
if none of the files that are not to be copied exist on the target before
you start.
--
HTH, Steve

Steve, couple things:

In your step (3), if I am to copy all those *winthout* the S attribute, would that be

copy /e /h /k /q /r /s /u /z c:\ D:\WINDOWSCOPY

or
copy /e /h /k /q /r /-s /u /z c:\ D:\WINDOWSCOPY

Secondly, trying to solve this (and maybe even learn something), would this work?


copy /[!Windows\ MSOCache\ RecoveryBin\ Recovery\ RECYCLER\ "System Volume Information\" hiberfil.sys $INPLACE.~TR\ $Recycle.Bin\ $WINDOWS.~Q\ Boot\ TEMP\] /e /h /k /q /r /s /u /z c:\*.* i:\WINDOWSCOPY

Regards,
Chuck
 
#7
| Steve, couple things:
|
| In your step (3), if I am to copy all those *winthout* the S
| attribute, would that be
|
| copy /e /h /k /q /r /s /u /z c:\ D:\WINDOWSCOPY
|
| or
| copy /e /h /k /q /r /-s /u /z c:\ D:\WINDOWSCOPY

Sorry, I left out the attribute selection option: /a:-s

|
| Secondly, trying to solve this (and maybe even learn something),
| would this work?
|
|
| copy /[!Windows\ MSOCache\ RecoveryBin\ Recovery\ RECYCLER\ "System
| Volume Information\" hiberfil.sys $INPLACE.~TR\ $Recycle.Bin\
| $WINDOWS.~Q\ Boot\ TEMP\] /e /h /k /q /r /s /u /z c:\*.*
| i:\WINDOWSCOPY

Probably. I'd also exlude pagefile.sys if it is on C:. And remember, * and
*.* match the same files in TCC.
--
Steve
 
#8
| Steve, couple things:
|
| In your step (3), if I am to copy all those *winthout* the S
| attribute, would that be
|
| copy /e /h /k /q /r /s /u /z c:\ D:\WINDOWSCOPY
|
| or
| copy /e /h /k /q /r /-s /u /z c:\ D:\WINDOWSCOPY

Sorry, I left out the attribute selection option: /a:-s

|
| Secondly, trying to solve this (and maybe even learn something),
| would this work?
|
|
| copy /[!Windows\ MSOCache\ RecoveryBin\ Recovery\ RECYCLER\ "System
| Volume Information\" hiberfil.sys $INPLACE.~TR\ $Recycle.Bin\
| $WINDOWS.~Q\ Boot\ TEMP\] /e /h /k /q /r /s /u /z c:\*.*
| i:\WINDOWSCOPY

Probably. I'd also exlude pagefile.sys if it is on C:. And remember, * and
*.* match the same files in TCC.
--
Steve
Thanks Steve.

Regards,
Chuck