1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Switches for COPY in batch files when paused

Discussion in 'Support' started by CWBillow, Dec 22, 2009.

  1. CWBillow

    Joined:
    Jul 12, 2008
    Messages:
    194
    Likes Received:
    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
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    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
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,869
    Likes Received:
    83
    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
     
  4. CWBillow

    Joined:
    Jul 12, 2008
    Messages:
    194
    Likes Received:
    0
    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



     
  5. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,311
    Likes Received:
    39
    Yes; A is a synonym for R. Type HELP PROMPTS for info.
     
  6. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,869
    Likes Received:
    83
    See "Page and File Prompts" in the help.

    Rex Conn
    JP Software
     
  7. CWBillow

    Joined:
    Jul 12, 2008
    Messages:
    194
    Likes Received:
    0
    Charles / Rex;

    OK guys, thanks.

    Regards,
    Chuck Billow
     

Share This Page