Loading ...
Sorry, an error occurred while loading the content.

/Y vs. /YY

Expand Messages
  • pmokover
    I just want to make sure I m correctly understanding the difference between /Y and /YY. Here s my understanding: /Y 1. Overwrite existing files 2. Don t
    Message 1 of 2 , Jan 1, 2009
    View Source
    • 0 Attachment
      I just want to make sure I'm correctly understanding the difference
      between /Y and /YY. Here's my understanding:

      /Y
      1. Overwrite existing files
      2. Don't prompt when overwriting

      /YY
      1. Don't prompt for anything
      2. Has nothing to do with overwriting

      Is that correct?

      Thanks.
      Peter
    • Kan Yabumoto
      ... That is essentially correct. However, there are a few (rare) cases where the user prompt cannot be suppressed by /YY --- typically, a type of the warning
      Message 2 of 2 , Jan 8, 2009
      View Source
      • 0 Attachment
        Peter wrote:

        > I just want to make sure I'm correctly understanding the difference
        > between /Y and /YY. Here's my understanding:
        >
        > /Y
        > 1. Overwrite existing files
        > 2. Don't prompt when overwriting
        >
        > /YY
        > 1. Don't prompt for anything
        > 2. Has nothing to do with overwriting
        >
        > Is that correct?

        That is essentially correct.

        However, there are a few (rare) cases where the user prompt cannot
        be suppressed by /YY --- typically, a type of the warning that
        relates to a licensing issue.

        Since there are so many types of warning message with XXCOPY,
        you might be tempted to use /YY as a habit. After all, no one
        is expected to memorize all the switches to suppress warning
        messages.

        We recommend that you let XXCOPY show a warning whenever the
        situation warrants. It is for your safety. When you are
        developing a batch file script that you intend to run
        unattended, you should enter "?" in response to the warning
        prompt and XXCOPY will show you the switch that would suppress
        the particular warning prompt. In some cases, you may need two
        or more such switches to suppress all warning prompts. But,
        it is safer than using a /YY which deprives you the benefit of
        the waring messages that may save your life.

        Here's a bad example of /YY usage.

        mybackup.bat
        -------------------------------------------------
        xxcopy c:\%1\ d:\backup\%2\ /clone /yy
        -------------------------------------------------

        This batch file accepts invocation arguments from the user
        (typically typed by hand). The /CLONE /YY could be a deadly
        combination with a typographical error.

        The /YY switch will help a well-designed batch file run
        unattended without an unexpected pause. But, we recommend
        that you use more specific switches to suppress warning messages.

        A good example:

        xxcopy /help /yy >xxhelp.txt // save output to a text file.


        Kan Yabumoto
      Your message has been successfully submitted and would be delivered to recipients shortly.