Robocopy can't exclude $recycle.bin

Status
Not open for further replies.

devil22

2[H]4U
Joined
Jan 1, 2003
Messages
3,837
This is my command line: robocopy d:\ e:\ /mir /l /xd $RECYCLE.BIN

And this is the output:

Code:
jgentile@quadbox●~\powershell►robocopy d:\ e:\ /mir /l /xd $RECYCLE.BIN
-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows
-------------------------------------------------------------------------------
  Started : Thu Jun 16 12:46:00 2011
   Source : d:\
     Dest : e:\
    Files : *.*
  Options : *.* /L /S /E /COPY:DAT /PURGE /MIR /R:1000000 /W:30
------------------------------------------------------------------------------
                           4    d:\
                           0    d:\$RECYCLE.BIN\
          New Dir          1    d:\$RECYCLE.BIN\S-1-5-21-2647135948-198952911-1883998332-1001\
            New File                 129        desktop.ini
                           1    d:\$RECYCLE.BIN\S-1-5-21-903913729-2069915181-891838863-1000\
            Older                    129        desktop.ini
2011/06/16 12:46:00 ERROR 5 (0x00000005) Scanning Source Directory d:\$RECYCLE.BIN\S-1-5-21-903913729-2069915181-891838863-1002\
Access is denied.
Waiting 30 seconds...^C
jgentile@quadbox●~\powershell►

I've tried D:\$recycle.bin, "$Recycle.bin" and so on, but it will not exclude the directory and keeps failing on it. So how do I exclude this directory and it's subdirectories? I've searched google and seen people with similar problems but I couldn't find a solution.

edit: Just figured out I can use /r:0 to eliminate the retry and it will continue to the rest of files, but I still want to know why it isn't excluding $recycle.bin ...

Uhg, NVM, it's because powershell treats $ as a variable indicator..doh.
 
Last edited:
Status
Not open for further replies.
Top