Home > OS >  Robocopy command is not copying files and folders
Robocopy command is not copying files and folders

Time:04-26

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.

CodePudding user response:

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

  • Related