Switches for COPY in batch files when paused

Jul 12, 2008
286
0
Las Vegas, NV
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
 
May 20, 2008
3,515
4
Elkridge, MD, USA
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
 

rconn

Administrator
Staff member
May 14, 2008
12,340
149
> 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
 
Jul 12, 2008
286
0
Las Vegas, NV
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
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,446
88
Albuquerque, NM
prospero.unm.edu
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.
 
Jul 12, 2008
286
0
Las Vegas, NV
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
Thread starter Title Forum Replies Date
fpefpe startup switches Support 2
cgunhouse WAD UNFUNCTION "/L" and "/G" Switches Support 9
C WAD VIEW print multiple files - switches fail Support 10
H DIR switches not working? Support 3
H DIR switches not working? Support 0
C Copy (sys) error Support 3
Alpengreis Fixed Crash after copy dialog with big TCC.exception.log Support 5
vefatica Copy/Paste anomaly Support 4
D Documentation Typo in COPY help Support 0
samintz COPY fails to copy from \\wsl$ Support 20
D Differences between TCC and CMD with COPY /b Support 4
fpefpe copy /u and timestamps Support 4
M Strange error messages from TCC in FTP copy Support 7
G TCMD crash when copy Support 3
Alpengreis How to? Copy DIRs with attributes ... Support 4
E Text copy bug Support 1
Alpengreis [TCMD v25.00.24] Problem with copy and paste and the # char via mouse in TCC Support 6
fpefpe copy/cat Support 7
K copy /w slow relative to robocopy /mir Support 0
Jay Sage Problem with Context Menu Copy+Paste+Run Key Assignment Support 7
K "copy /z /w" command not deleting read-only files in destination Support 10
K copy changing destination current directory Support 1
D Keystroke to copy previous argument Support 3
A How to? Copy+Paste in TCMD tabs with Ctrl-Shift-Ins? Support 5
RChrismon How to? Copy TCMD.INI to New Version Support 7
R How to? Append files in multiple subfolders using copy? Support 8
Dick Johnson COPY /u (?) Support 9
fpefpe Documentation copy /u Support 7
R How to? copy /q ABC.txt + DEF.txt is appending hex 1A Support 8
D copy /g only shows transfer rate Support 1
J Error "Contents lost before copy" Support 3
B Can copy command concatenate multiple mp3 files Support 2
rps Documentation "Copy+Paste+run" question Support 2
kb6ojs Make /G parameter persistent in COPY/MOVE command? Support 4
fpefpe How to? copy / exclude Support 2
fpefpe robocopy -- copy /w Support 8
C copy /w /p prompts for deletion, but ... Support 3
D Fixed Copy Support 1
fpefpe Documentation copy/move using /c or /u Support 2
samintz WAD Copy/append adds a character Support 3
P Simple RegEx copy Support 9
fromano Fixed COPY ... TO ... crashing Support 3
Alpengreis How to? Copy & Paste without linebreak within TCMD Support 13
D COPY returns ERRORLEVEL 2 Support 5
mdwyer TCC 13 COPY: specified network name is no longer available. Support 5
CWBillow Copy a tree Support 17
J junction copy/move handling Support 6
vefatica Fixed COPY /S ftp://... Support 1
C WAD copy /u ftp local with Timeout? Support 5
D How to? Unregister a copy of Take command Support 1

Similar threads