Robocopy options


  1. Posts : 7
    Windows 10 Pro, Ver 1903, Build 18362.836
       #1

    Robocopy options


    I have a batch file that contains this line
    Code:
    robocopy "E:\ame\Documents\_kunddata" "\\DESKTOP-2S2F2DJ\Backup\Kunddata" /MIR /W:1 /R:1  /LOG:C:\TEMP\BACKUP.LOG
    In the log file I get this
    Code:
    Options : *.* /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /R:1 /W:1
    So there are som extra options in the log file. /DCOPY and /COPY are the default values so I get them. Also /PURGE might make sense...

    But why is there both /S and /E ?
    Is they the opposite?
      My Computer


  2. Posts : 12,801
    Windows 11 Pro
       #2

    See if these links help
    ROBOCOPY - Create Backup Script - Windows 7 Help Forums
    https://docs.microsoft.com/en-us/win...mands/robocopy

    /s and /e copy subdirectories, but they seem somewhat at odds as one excludes empty directories and the other includes them. I doubt if it makes much difference though, the script I use shows the same thing and it works very well.
      My Computer


  3. Posts : 31,644
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #3

    No, /s /e are not really at odds. You only really need one or the other, but you'll often see both used together as a 'belt and braces' approach. From Robocopy /? ....
    /S :: copy Subdirectories, but not empty ones.
    /E :: copy subdirectories, including Empty ones.

    /S copies all subdirectories, but only the ones that contain files. /E does the same, but also copies any empty ones. XCopy has the same two options, with the same effects.
      My Computers


  4. Posts : 8,105
    windows 10
       #4

    Its simpler to use the free GUI as it writes it for you Add a Graphical User Interface (GUI) to the Microsoft Robocopy Command Line Tool
      My Computer


  5. Posts : 16,946
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #5

    Anders,

    My RoboCopy log always reports both /S and /E even though I have only used /E so that is nothing to be concerned about.

    Similarly, my RoboCopy log always reports both /Purge and /Mir even though I have only used /Mir so that is nothing to be concerned about either.
    [/Mir = /E + /Purge]

    I always use /Mir so I don't know whether or not the log would show those unexpected /E and /Purge if /Mir had not been used.

    Denis
    Last edited by Try3; 25 May 2020 at 06:32.
      My Computer


  6. Posts : 14
    Microsoft Windows 10 Home 64-bit Version 1909 Build 18363.720
       #6

    A big Thank You to all that has replied. I still find /s and /e contradictary, but everything seems to work...
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 04:01.
Find Us




Windows 10 Forums