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

COPY /W does not delete files in the target

Discussion in 'Support' started by Phileosophos, Jan 16, 2010.

  1. Phileosophos

    Joined:
    Aug 28, 2008
    Messages:
    86
    Likes Received:
    2
    I can't get the new /W switch for the COPY command to work as described with the latest update ("VER /R" reports TCC 11.00.38 x64 Windows Vista [Version 6.0.6002]). Here are the steps I'm taking:

    1. I create two testing folders C:\A and C:\B.
    2. I copy some documents into A.
    3. I copy all the documents from A to B.
    4. I add a new document to B that isn't in A.
    5. I execute: COPY /W C:\A\*.* C:\B\*.*
    The command does not delete the file I added to B that isn't in A. Can you please advise me as to why this is failing? Thanks.
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,788
    Likes Received:
    29
    On Sat, 16 Jan 2010 18:07:35 -0500, Phileosophos <> wrote:

    |I can't get the new /W switch for the COPY command to work as described with the latest update ("VER /R" reports TCC 11.00.38 x64 Windows Vista [Version 6.0.6002]). Here are the steps I'm taking:
    |
    |1. I create two testing folders C:\A and C:\B.
    |2. I copy some documents into A.
    |3. I copy all the documents from A to B.
    |4. I add a new document to B that isn't in A.
    |5. I execute: COPY /W C:\A\*.* C:\B\*.*
    |
    |The command does not delete the file I added to B that isn't in A. Can you please advise me as to why this is failing? Thanks.

    It works if you do it this way:

    v:\> copy /w dira\ dirb\
    Deleting V:\dirb\foobar.txt
    1 file deleted
    V:\dira\foo.txt => V:\dirb\foo.txt
    1 file copied
    --
    - Vince
     
  3. Phileosophos

    Joined:
    Aug 28, 2008
    Messages:
    86
    Likes Received:
    2
    First, thanks for the help, Vince, that does work. Second, is the "/W" switch really supposed to be limited like that, by which I mean you can't limit it to a particular filespec or anything like that? I didn't see anything about that in the documentation.
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,730
    Likes Received:
    80
    /W only works with directory names, not individual filenames.

    Rex Conn
    JP Software
     
  5. Phileosophos

    Joined:
    Aug 28, 2008
    Messages:
    86
    Likes Received:
    2
    Good to know. And it makes a certain sense. Allow me to quote the documentation:

    That really needs to be updated to make clear what you've said. :)
     

Share This Page