Robocopy command is not copying files and folders

Issue

Im attempting the simplest use of robocopy with powershell:

robocopy C:\Users\tkeen\Documents\test\ C:\Users\tkeen\Documents\test2\

It doesn’t seem to do anything. This is the response I get back:

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows
-------------------------------------------------------------------------------

  Started : Friday, April 22, 2022 5:51:41 PM
   Source : C:\Users\tkeen\Documents\test\
     Dest : C:\Users\tkeen\Documents\test2\

    Files : *.*

  Options : *.* /DCOPY:DA /COPY:DAT /R:1000000 /W:30

------------------------------------------------------------------------------

                           0    C:\Users\tkeen\Documents\test\

------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         0         1         0         0         0
   Files :         0         0         0         0         0         0
   Bytes :         0         0         0         0         0         0
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00
   Ended : Friday, April 22, 2022 5:51:41 PM

I tried with other options like \MIR but then I just get a "ERROR : Invalid Parameter #3 : \mir" message. Not sure what Im doing wrong.

Solution

Try Below

robocopy "Source" "destination" /MIR /E /XO /xx /tee /R:2 /W:1 /SEC /LOG:"o/p path"

MIR – mirrors directory – deletes files which is present in destination but not in source
E – copies subdirectories even folder is empty
X0 – excludes older files – we can say for incremental
xx – excludes extra files – will not delete extra files in destination (XX overtakes MIR)
tee – gives output in command prompt also
R – Number of Retries on failure
W – Wait time between Retries
SEC – copy with security
LOG – output path

Answered By – NK149

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published