Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Switches for COPY in batch files when paused

Jul
304
0
If I am copying from one drive to another using a batch file with a command line like (all on single line) -- (Is there a way to make it not wrap the line?)

except (C:\hiberfil.sys) copy /[!WINDOWS\ MSOCache\ RecoveryBin\ Recovery\ RECYCLER\ "System Volume Information\" TEMP\] /e /h /k /q /r /s /u /z c:\*.* i:\WINDOWSCOPY

and I want to add the recycle bins for *all* drives,

1) Does case matter -- RECYCLE v. Recycle
2) Is there a way to add all the recycle bins for "any" drive rather than entering each one separately?

Regards,
Chuck Billow
 
CWBillow wrote:
| If I am copying from one drive to another using a batch file with a
| command line like (all on single line) -- (Is there a way to make it
| not wrap the line?)
|
| except (C:\hiberfil.sys) copy /[!WINDOWS\ MSOCache\ RecoveryBin\
| Recovery\ RECYCLER\ "System Volume Information\" TEMP\] /e /h /k /q
| /r /s /u /z c:\*.* i:\WINDOWSCOPY
|
| and I want to add the recycle bins for *all* drives,
|
| 1) Does case matter -- RECYCLE v. Recycle

No. Windows files systems, both VFAT and NTFS, are case insensitive when
retrieving existing files and directories.

| 2) Is there a way to add all the recycle bins for "any" drive
| rather than entering each one separately?

If you mean that you want the single COPY command to save all
drive:\RECYCLER\ directories from all drives, I am not aware of any syntax
to do that. What you would need is a "@multiexpand[*:\RECYCLER]" function,
which can accept wildcards in the drive name, and which would create
different filenames on the single target for each one. You need to do this
yourself, e.g. (UNTESTED!!!):

for %d in ( %_hdrives ) if isdir %d\RECYCLER copy/e/h/k/q/r/z/md
%d\RECYCLER\* i:\WINDOWSCOPY\Recycler\%@left[1,%d]\

BTW, I suspect your original command is faulty. There is a short paragraph
in help topic "except.html" that EXCEPT does not work when the /H option of
most commands, in this case COPY, is used. If your command did not copy
hiberfil.sys, that was because either it did not exist, or was not "newer".
Please note that some work files of the OS, e.g., pagefile.sys, are not
subject to the usual rules of updating the file's directory entry when the
file is accessed or modified.
--
HTH, Steve
 
> If I am copying from one drive to another using a batch file with a
> command line like (all on single line) -- (Is there a way to make it
> not wrap the line?)
>
> except (C:\hiberfil.sys) copy /[!WINDOWS\ MSOCache\ RecoveryBin\
> Recovery\ RECYCLER\ "System Volume Information\" TEMP\] /e /h /k /q /r
> /s /u /z c:\*.* i:\WINDOWSCOPY

There's no reason to use EXCEPT (which is intended for external commands),
and which is useless when combined with the COPY /H switch. Use file
exclusion ranges for internal commands like COPY.


> and I want to add the recycle bins for *all* drives,
>
> 1) Does case matter -- RECYCLE v. Recycle

No.


> 2) Is there a way to add all the recycle bins for "any" drive rather
> than entering each one separately?

No.

Rex Conn
JP Software
 
Steve / Rex:

I obviously have to take another look at the "except" functions.

Incidently, what are the (Y/N/A/R) switches when the batch file pauses? I tried finding something inh help, but couldn't seem to do so.

I *thought* that the "A" is "all files do this to",...?

Regards,
Chuck Billow



CWBillow wrote:
| If I am copying from one drive to another using a batch file with a
| command line like (all on single line) -- (Is there a way to make it
| not wrap the line?)
|
| except (C:\hiberfil.sys) copy /[!WINDOWS\ MSOCache\ RecoveryBin\
| Recovery\ RECYCLER\ "System Volume Information\" TEMP\] /e /h /k /q
| /r /s /u /z c:\*.* i:\WINDOWSCOPY
|
| and I want to add the recycle bins for *all* drives,
|
| 1) Does case matter -- RECYCLE v. Recycle

No. Windows files systems, both VFAT and NTFS, are case insensitive when
retrieving existing files and directories.

| 2) Is there a way to add all the recycle bins for "any" drive
| rather than entering each one separately?

If you mean that you want the single COPY command to save all
drive:\RECYCLER\ directories from all drives, I am not aware of any syntax
to do that. What you would need is a "@multiexpand[*:\RECYCLER]" function,
which can accept wildcards in the drive name, and which would create
different filenames on the single target for each one. You need to do this
yourself, e.g. (UNTESTED!!!):

for %d in ( %_hdrives ) if isdir %d\RECYCLER copy/e/h/k/q/r/z/md
%d\RECYCLER\* i:\WINDOWSCOPY\Recycler\%@left[1,%d]\

BTW, I suspect your original command is faulty. There is a short paragraph
in help topic "except.html" that EXCEPT does not work when the /H option of
most commands, in this case COPY, is used. If your command did not copy
hiberfil.sys, that was because either it did not exist, or was not "newer".
Please note that some work files of the OS, e.g., pagefile.sys, are not
subject to the usual rules of updating the file's directory entry when the
file is accessed or modified.
--
HTH, Steve
 
Steve / Rex:

I obviously have to take another look at the "except" functions.

Incidently, what are the (Y/N/A/R) switches when the batch file pauses? I tried finding something inh help, but couldn't seem to do so.

I *thought* that the "A" is "all files do this to",...?

Yes; A is a synonym for R. Type HELP PROMPTS for info.
 
There's no reason to use EXCEPT (which is intended for external commands),
and which is useless when combined with the COPY /H switch. Use file
exclusion ranges for internal commands like COPY.




No.




No.

Rex Conn
JP Software

Charles / Rex;

OK guys, thanks.

Regards,
Chuck Billow
 

Similar threads

Replies
7
Views
2K
Back
Top