A-Z List


Robocopy

Published: February 26, 2008

Updated: April 17, 2012

Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2

Copies file data.

Syntax

robocopy <Source> <Destination> [<File>[ ...]] [<Options>]
Parameters

 

Parameter Description

<Source>

Specifies the path to the source directory.

<Destination>

Specifies the path to the destination directory.

<File>

Specifies the file or files to be copied. You can use wildcard characters (* or ?), if you want. If the File parameter is not specified, *.* is used as the default value.

<Options>

Specifies options to be used with the robocopy command.

Copy options

 

Option Description

/s

Copies subdirectories. Note that this option excludes empty directories.

/e

Copies subdirectories. Note that this option includes empty directories. For additional information, see Remarks.

/lev:<N>

Copies only the top N levels of the source directory tree.

/z

Copies files in Restart mode.

/b

Copies files in Backup mode.

/zb

Uses Restart mode. If access is denied, this option uses Backup mode.

/efsraw

Copies all encrypted files in EFS RAW mode.

/copy:<CopyFlags>

Specifies the file properties to be copied. The following are the valid values for this option:

D Data

A Attributes

T Time stamps

S NTFS access control list (ACL)

O Owner information

U Auditing information

The default value for CopyFlags is DAT (data, attributes, and time stamps).

/dcopy:T

Copies directory time stamps.

/sec

Copies files with security (equivalent to /copy:DAT).

/copyall

Copies all file information (equivalent to /copy:DATSOU).

/nocopy

Copies no file information (useful with /purge).

/secfix

Fixes file security on all files, even skipped ones.

/timfix

Fixes file times on all files, even skipped ones.

/purge

Deletes destination files and directories that no longer exist in the source. For additional information, see Remarks.

/mir

Mirrors a directory tree (equivalent to /e plus /purge). For additional information, see Remarks.

/mov

Moves files, and deletes them from the source after they are copied.

/move

Moves files and directories, and deletes them from the source after they are copied.

/a+:[RASHCNET]

Adds the specified attributes to copied files.

/a-:[RASHCNET]

Removes the specified attributes from copied files.

/create

Creates a directory tree and zero-length files only.

/fat

Creates destination files by using 8.3 character-length FAT file names only.

/256

Turns off support for very long paths (longer than 256 characters).

/mon:<N>

Monitors the source, and runs again when more than N changes are detected.

/mot:<M>

Monitors source, and runs again in M minutes if changes are detected.

/MT[:N]

Creates multi-threaded copies with N threads. N must be an integer between 1 and 128. The default value for N is 8.

The /MT parameter cannot be used with the /IPG and /EFSRAW parameters.

Redirect output using /LOG option for better performance.

noteNote
The /MT parameter applies to Windows Server 2008 R2 and Windows 7.

/rh:hhmm-hhmm

Specifies run times when new copies may be started.

/pf

Checks run times on a per-file (not per-pass) basis.

/ipg:n

Specifies the inter-packet gap to free bandwidth on slow lines.

/sl

Copies the symbolic link instead of the target.

ImportantImportant
When using the /SECFIX copy option, specify the type of security information you want to copy by also using one of these additional copy options:

  • /COPYALL

  • /COPY:O

  • /COPY:S

  • /COPY:U

  • /SEC

File selection options

 

Option Description

/a

Copies only files for which the Archive attribute is set.

/m

Copies only files for which the Archive attribute is set, and resets the Archive attribute.

/ia:[RASHCNETO]

Includes only files for which any of the specified attributes are set.

/xa:[RASHCNETO]

Excludes files for which any of the specified attributes are set.

/xf <FileName>[ ...]

Excludes files that match the specified names or paths. Note that FileName can include wildcard characters (* and ?).

/xd <Directory>[ ...]

Excludes directories that match the specified names and paths.

/xct

Excludes changed files.

/xn

Excludes newer files.

/xo

Excludes older files.

/xx

Excludes extra files and directories.

/xl

Excludes "lonely" files and directories.

/is

Includes the same files.

/it

Includes "tweaked" files.

/max:<N>

Specifies the maximum file size (to exclude files bigger than N bytes).

/min:<N>

Specifies the minimum file size (to exclude files smaller than N bytes).

/maxage:<N>

Specifies the maximum file age (to exclude files older than N days or date).

/minage:<N>

Specifies the minimum file age (exclude files newer than N days or date).

/maxlad:<N>

Specifies the maximum last access date (excludes files unused since N).

/minlad:<N>

Specifies the minimum last access date (excludes files used since N) If N is less than 1900, N specifies the number of days. Otherwise, N specifies a date in the format YYYYMMDD.

/xj

Excludes junction points, which are normally included by default.

/fft

Assumes FAT file times (two-second precision).

/dst

Compensates for one-hour DST time differences.

/xjd

Excludes junction points for directories.

/xjf

Excludes junction points for files.

Retry options

 

Option Description

/r:<N>

Specifies the number of retries on failed copies. The default value of N is 1,000,000 (one million retries).

/w:<N>

Specifies the wait time between retries, in seconds. The default value of N is 30 (wait time 30 seconds).

/reg

Saves the values specified in the /r and /w options as default settings in the registry.

/tbd

Specifies that the system will wait for share names to be defined (retry error 67).

Logging options

 

Option Description

/l

Specifies that files are to be listed only (and not copied, deleted, or time stamped).

/x

Reports all extra files, not just those that are selected.

/v

Produces verbose output, and shows all skipped files.

/ts

Includes source file time stamps in the output.

/fp

Includes the full path names of the files in the output.

/bytes

Prints sizes, as bytes.

/ns

Specifies that file sizes are not to be logged.

/nc

Specifies that file classes are not to be logged.

/nfl

Specifies that file names are not to be logged.

/ndl

Specifies that directory names are not to be logged.

/np

Specifies that the progress of the copying operation (the number of files or directories copied so far) will not be displayed.

/eta

Shows the estimated time of arrival (ETA) of the copied files.

/log:<LogFile>

Writes the status output to the log file (overwrites the existing log file).

/log+:<LogFile>

Writes the status output to the log file (appends the output to the existing log file).

/unicode

Displays the status output as Unicode text.

/unilog:<LogFile>

Writes the status output to the log file as Unicode text (overwrites the existing log file).

/unilog+:<LogFile>

Writes the status output to the log file as Unicode text (appends the output to the existing log file).

/tee

Writes the status output to the console window, as well as to the log file.

/njh

Specifies that there is no job header.

/njs

Specifies that there is no job summary.

Job options

 

Option Description

/job:<JobName>

Specifies that parameters are to be derived from the named job file.

/save:<JobName>

Specifies that parameters are to be saved to the named job file.

/quit

Quits after processing command line (to view parameters).

/nosd

Indicates that no source directory is specified.

/nodd

Indicates that no destination directory is specified.

/if

Includes the specified files.

Remarks

  • The /mir option is equivalent to the /e plus /purge options with one small difference in behavior:

    • With the /e plus /purge options, if the destination directory exists, the destination directory security settings are not overwritten.

    • With the /mir option, if the destination directory exists, the destination directory security settings are overwritten.

Additional references

Command-Line Syntax Key

Tags :


Community Content

fan711
/sec documentation
<span>For /sec options the documentations states 'Copies files with security (equivalent to </span><strong>/copy:DAT</strong><span>).'</span> $0$0 $0 $0<span>Using /sec robocopy copies ACLs as well so it should IMO read '</span><span>Copies files with security (equivalent to </span><strong>/copy:DATS</strong><span>).'</span>$0 $0<span>$0 </span>$0
Tags :

TXWizard
Explanation of Tweaked, Lonely, and Extra
I found the explanation of the terms tweaked, lonely, and extra, posted at &lt; <mtps:InstrumentedLink NavigateUrl="http://superuser.com/questions/314503/what-does-robocopy-mean-by-tweaked-lonely-and-extra" runat="server" xmlns:mtps="http://msdn2.microsoft.com/mtps">http://superuser.com/questions/314503/what-does-robocopy-mean-by-tweaked-lonely-and-extra</mtps:InstrumentedLink>&gt; to be immensely beneficial.
Tags :

Teufel0
Please watch
<br /> Please watch ACL on the root directory! When you copy data with ROBOCOPY, ACL is set like MOVEd inside a volume. So you have to correct inheritance.<br /> •To preserve existing permissions without adding inheritable permissions from the parent folder, use the Robocopy.exe utility ----&gt; http://support.microsoft.com/default.aspx?scid=kb;EN-US;310316<br />  <br /> If you copy files named like 8.3 short names (aaaaaa~n.aaa), ROBOCOPY can overwrite a long named file, that got this short name in the same job! ----&gt;   http://support.microsoft.com/kb/195144/en-us
Tags :

pedersenjor
Robocopy /B and extended attributes
Need robocopy to copy files from one NAS solution to another. $0When /b is used the job fails because robocopy copy extended attributes and the source does not support these attributes.$0 $0Need a option to dun robocopy in backup mode without copying the extended attributes, but still standard windows attributes $0 $0Any clue ?$0
Tags :

Jh1682
Would like to have two new parameters: chost, cowner
Would like to have two new parameters: <br /><ul><li>/chost: create Source_computer_subdirectory</li><li>/cowner: create source_owner_subdirectory</li></ul><p>We collect data from thousands desktop periodically.<br />It will be very helpful if the destination files are automatically put under the subdirectory of source_computer_name\source_owner\<br /> <br />For example:<br />John has files at \\computer_abc\xyz\my*.txt<br />Assume robocopy has two parameters: /chost, /cowner<br /><br />Run command:<br />robocopy /chost /cowner \\computer_abc\xyz\my*.txt c:\dest\*<br /> <br />We want the result been copied to c:\dest\computer_abc\John\my*.txt<br /> <br />The collected files with the visible computer name and owner will be more useful for other software. for example Splunk.<br /> <br />Thanks<br />Sincerely<br />John Hsu<br /></p>
Tags :

Jh1682
Would like to have minimum hours ago parameter /minageh
It will be very helpful for me that adding minimum hours ago of last written activity to the file<br />
Tags :

Maxim Golov
/MIN:n option
Looks like the largest number which can be specified with the /MIN option is 999 999 999 bytes (version XP010). Was it increased in the later versions?
Tags :

www.candc-uk.com
Long file name or Hyphens in the file name
<p>I use the following command<br /><br /><br /><br /> C:\&amp;amp;amp;gt;robocopy "F:\Autodesk_2011\ACADMEP_2011_32\AdminImage\support" "X:\AutoDesk\<br /> Deployment\Autodesk_2011\ACADMEP_2011_32\AdminImage\support" /e <br /><br /> Robocopy details are;<br /><br /> ROBOCOPY :: Robust File Copy for Windows<br /> ------------------------------------------------------------------------------- <br /><br /><br /><br /> Started : Thu Sep 16 10:49:28 2010<br /><br /> Source : F:\Autodesk_2011\ACADMEP_2011_32\AdminImage\support\<br /> Dest = X:\AutoDesk\Deployment\Autodesk_2011\ACADMEP_2011_32\AdminImage\supp<br /> ort\<br /><br /> Files : *.*<br /><br /> Options : *.* /S /E /COPY:DAT /R:1000000 /W:30<br /> ------------------------------------------------------------------------------ <br /><br /> It stops in the following file. waiting for 30 seconds...<br /><br /> F:\Autodesk_2011\ACADMEP_<br /> 2011_32\AdminImage\support\ADSKMaterials\CM\Common\Autodesk Shared\Materials2011<br /> \assetlibrary_base.fbm\1\Mats\Doors - Windows.Glazed Curtain Walls.Stainless Ste<br /> el Curtain Wall.jpg<br /> The request is not supported.<br /> Waiting 30 seconds...<br /><br /> Is it cause there are hyphens, dots and spaces in the file Name? If so how can I copy them over?<br /> Xcopy with /N will copy the files over, but the folder and file paths are truncated and not much of a use.<br /><br /> Any help to resolve the above is much appreciated.</p> <blockquote> <p>If I were to guess, I'd say you are hitting MAX_PATH issues. Many Windows functions have a limit on the total length of paths they can support. According to some docs, that limit is 260 characters (including spaces, colons, slashes, dots, etc). The path you have specified above is slightly shorter than that (225 chars), but it might resolve to a location other than specified. In particular, if X: is a mapped drive to a network share, the share it is mapped to will have a real path that will be included in the target path.<br /></p> <p> <br /> </p> <p>For example: if X: is a mapped drive to the UNC path \\server\share\backups\user\yyyy-mm-dd, the failed path would be \\server\share\backups\user\yyyy-mm-dd\AutoDesk\Deployment\Autodesk_2011\ACADMEP_2011_32\AdminImage\support\ADSKMaterials\CM\Common\Autodesk Shared\Materials2011\assetlibrary_base.fbm\1\Mats\Doors - Windows.Glazed Curtain Walls.Stainless Steel Curtain Wall.jpg, which is 261 chars (1 char greater than MAX_PATH)</p> <p> <br /> </p> <p>Remember, of course, that \\server\share may also map to a much longer path on that server, \\server\share could, for example be D:\FileShares\UserBackups\. In that case, it may be the remote server refusing the full path based on its local representation of D:\FileShares\UserBackups\user\yyyy-mm-dd\AutoDesk\Deployment\Autodesk_2011\ACADMEP_2011_32\AdminImage\support\ADSKMaterials\CM\Common\Autodesk Shared\Materials2011\assetlibrary_base.fbm\1\Mats\Doors - Windows.Glazed Curtain Walls.Stainless Steel Curtain Wall.jpg (264 chars)<br /></p> </blockquote>
Tags :

Don Reynolds
Feature Request - Copy Top Sorted Files
<p>I love ROBOCOPY! It works great for most of my sync and backup needs, except when I have a folder structure full of large files (SQL database backups) and I only want to transfer the latest file from each folder in the tree. <br /></p><p>I would like to suggest some simple new parameters to handle this and a variety of other possible uses.<br /></p><p>/FILEORDERBY:[Modified|Created|Name|Type|Size]<br />This would sort the source files by the specified attribute.<br /></p><p>/FILEORDER:[ASC|DESC]<br />This would specifiy the source file sorting direction if /FILEORDERBY is specified. <br />If /FILEORDER is specified without ASC|DESC or /FILEORDERBY, default to Name ASC.<br /></p><p>/FILECOUNTPERDIR:[N]<br />This would specify the max number of files to copy for each source folder.<br /></p><p>/FILECOUNT:[N]<br />This would specify the max total number of files to copy from all source folders. </p>

HK WooD
Is it a bug?
<div>There may be a bug in the "robocopy" command.</div> <div>Here is the command that I run</div> <div>robocopy "\\DEV-PC\Win\VMware" "%USERPROFILE%\Desktop\VMware\V /S"</div> <div> <br /> </div> <div>When the process is completed, the system blocks me to delete the folder %USERPROFILE%\Desktop\VMware\. It shows "Could not find this item"</div> <div>I try to view the properties of that folder. The information of the fields, "Created", "Modified", "Accessed"... cannot be shown.</div> <div>I try to restart my PC to do the previous actions. It still doesn't work.</div> <div>This seems that it breaks the file system.</div>
Tags : bug

Thomas Lee
Issue with /SECFIX in Win2008 x64 version of Robocopy
Although support for the /secfix switch was removed from earlier versions, the W2k8 x64 (SP2) version of robocopy produces the following error:<br /> ERROR: /SECFIX specified, without specifying WHICH security info to copy.<br /><br /> I can't find any information on parameters for the /SECFIX switch.<br /><br /><b>[tfl - 04 12 11] Hi - and thanks for your post. Community content is not the appropriate place for technical support queries. Instead, <br /> you should visit the Technet Forums at http://forums.microsoft.com/technet, where such posts are welcomed and where you stand a much <br /> better chance of getting your query resolved. Sorry if that's not the answer you wanted to hear.</b><br />

Thomas Lee
Older versions corrupt destination file when file is 2gb (exactly)
Copying files that are 2,147,483,648 bytes produces no error in the log, however it appears to corrupt the destination file. This was in a 1997 copy (v 1.71). Upgrading to Version XP026 seemed to allow the files to copy correctly and not be corrupted.<br /><br /><b>[tfl - 04 12 11] Hi - and thanks for your post. Community content is not the appropriate place for technical support queries. Instead, <br /> you should visit the Technet Forums at http://forums.microsoft.com/technet, where such posts are welcomed and where you stand a much <br /> better chance of getting your query resolved. Sorry if that's not the answer you wanted to hear.</b><br />
Tags : needsforum

Thomas Lee
robocopy /z is slower than normal copy
<br /> Copying files in restartable mode is much slower (about 6x over a network) than in normal or backup mode due to the necessary management overhead
Tags : performance

Thomas Lee
How to exclude files when using /MIR?
Can i use /XF option when doing drive mirror (/MIR option)? I need to mirror the folder, but have to exclude for example .abc file type. <br /><br /> Thnks.<br /><br /><b>[tfl - 04 12 11] Hi - and thanks for your post. Community content is not the appropriate place for technical support queries. Instead, <br /> you should visit the Technet Forums at http://forums.microsoft.com/technet, where such posts are welcomed and where you stand a much <br /> better chance of getting your query resolved. Sorry if that's not the answer you wanted to hear.</b><br />

Thomas Lee
Any way to make the 027 run on WS2003?
Hi, I would like to use the 027 so to preserve the folders timestamps. but I would like to launch the copy from a WS2003 machine.<br /> When I try to do so, I get "not a valid win32 application". The 010 runs fine, but I don't have the D:/TS option!<br /> Any way to make it work?<br /> Thanks<br /><br /><b>[tfl - 04 12 11] Hi - and thanks for your post. Community content is not the appropriate place for technical support queries. Instead, <br /> you should visit the Technet Forums at http://forums.microsoft.com/technet, where such posts are welcomed and where you stand a much <br /> better chance of getting your query resolved. Sorry if that's not the answer you wanted to hear.</b><br />
Tags : needsforum

Thomas Lee
Copy to one map...
(Backup) programs can create chaos if used wrong..... Original map structures (and backup structures) mixed as a soup without possibility to filter the latest versions of files in that chaos.<br /> Robocopy and xcopy will always create the map structure again, and that's no gain in such situation.<br /><br /> An option to search all sub's, but use ONE map as final destination (no sub's) would be, in combination with all the other options like date/time filtering for overwriting, a useful tool. Slow, but useful.<br />
Tags :

Thomas Lee
Long file name or Hyphens in the file name
<b>[tfl - 04 12 11] Hi - and thanks for your post. Community content is not the appropriate place for technical support queries. Instead, <br /> you should visit the Technet Forums at http://forums.microsoft.com/technet, where such posts are welcomed and where you stand a much <br /> better chance of getting your query resolved. Sorry if that's not the answer you wanted to hear.</b>
Tags : needsforum

Thomas Lee
Multi-threaded (/MT) mirror of large folder structure takes longer than single threaded
There are tens of thousands of folders nested in the source.<br /><br /> When I run this command, it creates the header in the log file, but takes 1.5 hours before the first log entry is written.<br /> robocopy "\\server\Folder" "\\server2\folder" /MIR /Z /R:1 /W:1 /ETA /FFT /MT:8 /LOG+:"c:\Report\Folder.txt"<br /><br /> If I take out the /MT:8 switch and run this command, it immediately starts writing entries to the log file<br /> robocopy "\\server\Folder" "\\server2\folder" /MIR /Z /R:1 /W:1 /ETA /FFT /LOG+:"c:\Report\Folder.txt"<br /><br /> What is going on here?<br /><br /> Possible bug?<br /><br /><b>[tfl - 04 12 11] Hi - and thanks for your post. Community content is not the appropriate place for technical support queries. Instead, <br /> you should visit the Technet Forums at http://forums.microsoft.com/technet, where such posts are welcomed and where you stand a much <br /> better chance of getting your query resolved. Sorry if that's not the answer you wanted to hear.</b><br /><br />
Tags : needsforum

Thomas Lee
Move Users?
I created a separate partition for Users on a new PC running Windows 7. However there were two accounts which already existed on the primary partition, and those account still have their original directories on "C:\Users". Can I use robocopy to move the remaining folders and files along with all the security settings to the new partition? What would be the correct syntax? What registry setting will I need to edit? <br /><br /><b>[tfl - 04 12 11] Hi - and thanks for your post. Community content is not the appropriate place for technical support queries. Instead, <br /> you should visit the Technet Forums at http://forums.microsoft.com/technet, where such posts are welcomed and where you stand a much <br /> better chance of getting your query resolved. Sorry if that's not the answer you wanted to hear.</b><br />
Tags : needsforum

Thomas Lee
Robocopy /Mov shows "extra" files in log
Hi.<br /><br /> Is it possible to stop the logging function of robocopy, when moving files from a source to a destination, from listing the extra files in the destination folder, in the log file?<br /> , <br /> Thanks.<br /> Morne<br /><br /><b>[tfl - 04 12 11] Hi - and thanks for your post. Community content is not the appropriate place for technical support queries. Instead, <br /> you should visit the Technet Forums at http://forums.microsoft.com/technet, where such posts are welcomed and where you stand a much <br /> better chance of getting your query resolved. Sorry if that's not the answer you wanted to hear.</b><br />
Tags : needsforum

Thomas Lee
verified copy?
<p>I've read in msdn/technet that the "/V" switch in copy/xcopy and the "verify on" command doesn't make a check like the FC command can do. In what ROBOCOPY is differend, about this? <br /></p> <p> <br /> </p> <p /> <p>Does robocopy verify after the copy of the file that all has gone well? There is no official content about this. Can someone tell us something about this? I think there are thousands of users of robocopy in the world. Some answers will be very appreciated!</p> <p>I know that robocopy is not "officially supported" and so on... i know also that the KB stated that "verify on" is "not supported" because MS-DOS is not supported... but "verify" is part of CMD utilities in XP, Vista, Seven, Win2003 and 2008. Not supported? :-)</p> <p> <br /> </p> <p> <b>[tfl - 04 12 11] Hi - and thanks for your post. Community content is not the appropriate place for technical support queries. Instead, <br /> you should visit the Technet Forums at http://forums.microsoft.com/technet, where such posts are welcomed and where you stand a much <br /> better chance of getting your query resolved. Sorry if that's not the answer you wanted to hear.</b> </p>
Tags : needsforum

Thomas Lee
Robocopy error: Access is denied
I receive an error 5 "access is denied" when using Robocopy when copy content for a share to a new server. As a domain admin, I have full permission everywhere. Have tripled check source and destination permissions as well as share permission. All is good. I can successfully "cut and paste" from same location, but cannot Robocopy. Please help!!!<br /><br /><b>[tfl - 04 12 11] Hi - and thanks for your post. Community content is not the appropriate place for technical support queries. Instead, <br /> you should visit the Technet Forums at http://forums.microsoft.com/technet, where such posts are welcomed and where you stand a much <br /> better chance of getting your query resolved. Sorry if that's not the answer you wanted to hear.</b><br />
Tags : needsforum

synodontis
Robocopy missing files when using the /MIR switch
I have MDT 2010… I am using USB flash drives for my support staff to be able to image workstations.<br /><br />I put together a simple batch file robocopy process for them to use to sync their drives with the source bits. Today I was troubleshooting an issue where I KNEW the drivers had been imported and noticed for the first time that robocopy, using the /MIR option is skipping files when doing the synch.<br /><br />I suspect it has something to do with the long file name. It skips the entire directories. If I change the command line to force it to one of those dirs., I get an error 2 (unable to find the file) <br /><br />The server where these shares resides is 2008, r2. I have tried running the robocopy program from xp or win7. I have tried all the versions of robocopy I can find, whatever came b4 2003, 2003, win7, server2008… I can drag and drop the folders to the flash drive without issue. I can use Beyond Compare and sync the folders. I can use Rich Copy and sync the folders. But robocopy has blinders on… WEIRD!!! I have checked the attributes on the folders and files and there is no hidden attribute set. <br /><br />Here’s the contents of the batch file I am running<br />set /p usbdrive=[enter the drive letter of the usb drive. All data will be lost]<br />\\server\media$\ROBOCOPY.EXE "\\server\media$\content" %usbdrive%: /R:1 /W:1 /MIR<br /><br /><br />FOUND ISSUE!!! Someone dinked with my shares and pointed them at a restored folder... robocopy was doing exactly what it should have
Tags : bug robocopy

www.candc-uk.com
ROBOCOPY Crash server
<p>After using ROBOCOPY with MIR option SBS server 2008 64bit crash and create a zip folder in the destination, but zip could not be open or view. I lost all previous file in destination.</p> <blockquote> <p>This appears to be because ROBOCOPY will try to overwrite an existing file rather than write a temporary file which it then renames on success. A switch to allow it to use a temporary file would be preferable but the only way around it that I know of is to use a temporary folder on the same drive as the target folder, then move the files into the target folder, if there are no errors. Something like this should do it:</p> <blockquote> <pre>ROBOCOPY C:\source D:\temp *.* /MIR<br />ROBOCOPY D:\temp D:\target *.* /MOVE<br /></pre> </blockquote> <p /> </blockquote> <p />
Tags : crash robocopr

www.candc-uk.com
Dynamically change /IPG: parameter while robocopy is running
<p>How can you change the /IPG:n parameter while robocopy is running? If this is possible, one can dynamically change the bandwidth use when also using the options /mir /mon:1. This way one can claim more WAN bandwidth in the night and throttle it during the day without interrupting the synchronisation process.</p> <blockquote> <p>I do something close-enough by running two separate ROBOCOPY /MON jobs, one with "/IPG:300 /RH:0800-1759 /PF" and one with "/IPG:0 /RH:1800-0759 /PF". The /RH switch (in at least XP010) tells it to run between two times. The /PF switch tells it to check that time on every file copy.<br /></p> </blockquote>
Tags :

William Lee
When does monitor mode kick in?
Scenario, im copying a large directory with monitor mode enabled /mon:1 .. say 1tb with millions of files and it takes 1 day to copy. After robocopy passes a folder called "answer" and now is copying a folder called "base", if there is a new file added to the "answer" folder will that new file be replicated to the destination folder once the copy is done? OR does monitor mode only kick in after the entire directory is done copying, meaning my file added during the inital copy will no be replicated?
Tags :

techvet2
Agree with 'Robocopy /Mov shows "extra" files in log' posting
Robocopy on Server 2008 R2 really does a slam-bang job using SMB2.x, but when using /MOV it still shows the "extra files" even though we are clearly not using the option to show it.<br />
Tags :

bit_head
Robocopy trouble with spaces in subdirs of destination
<p>UPDATE (since I can't delete the original post): There must have been an errant control character in the directory name. Once I renamed "a_b_c" back to "a b c", all works as it should! The original post follows...<br /><br />Here is the code I am running:<br /><br /></p> <pre>set satpath=D:\torrents<br />set wdpath=\\wdtvlive\Seagate\Video<br />robocopy %satpath% %wdpath% /XO /FFT /S /E<br /></pre> <p> <br />The above works fine until a directory needs to be created below a directory with spaces in its name. For example, if the source directory is...<br /><br />D:\torrents\a b c\d e f<br /><br />...and...<br /><br />\\wdtvlive\Seagate\Video\a b c<br /><br />...exists, but...<br /><br />\\wdtvlive\Seagate\Video\a b c\d e f<br /><br />...does not exist, the command chokes with...<br /><br /></p> <pre>-------------------------------------------------------------------------------<br /> Started : Sun Oct 09 16:31:03 2011<br /> Source : D:\torrents\<br /> Dest : \\wdtvlive\Seagate\Video\<br /> Files : *.*<br /> Options : *.* /FFT /S /E /COPY:DAT /XO /R:1000000 /W:30<br />------------------------------------------------------------------------------<br /> 0 D:\torrents\a b c\<br /> New Dir 8 D:\torrents\a b c\d e f<br /><br />2011/10/09 16:31:04 ERROR 2 (0x00000002) Creating Destination Directory \\wdtvli<br />ve\Seagate\Video\a b c\d e f\<br /><br />The system cannot find the file specified.<br />Waiting 30 seconds...<br /></pre> <p> <br />On the other hand, if I change "a b c" to "a_b_c", all works as desired. While the fix is simple, it should not be necessary. <br /><br />I tried using quotes around the source and destination but it doesn't help as the spacey names appear after the source and destination paths are defined. With quotes, it would appear as "D:\torrents"\a b c\d e f and "\\wdtvlive\Seagate\Video"\a b c\d e f, which is really bad syntax.<br /><br />I've done lots of searching and only come with "use quote" and "don't terminate the path with a "\". Fresh ideas wanted! :-)</p>

lowly
Robocopy does not work when i enter the command as below
source : c:\apps\epo_agent<br /><br />destination : <mtps:InstrumentedLink NavigateUrl="file://\\w1043acm06101\C$\apps" runat="server" xmlns:mtps="http://msdn2.microsoft.com/mtps">\\w1043acm06101\C$\apps</mtps:InstrumentedLink><br /><br />file : *.*<br /><br />options : /e/sec/r:1/w:1/log+:C:\tools\replication.txt<br /><br />commands : "c:\apps\epo_agent""\<mtps:InstrumentedLink NavigateUrl="file://\\w1043acm06101\C$\apps&amp;quot; *.*/e/sec/r:1/w:1/log+:C:\tools\replication.txt" runat="server" xmlns:mtps="http://msdn2.microsoft.com/mtps">\w1043acm06101\C$\apps" *.*/e/sec/r:1/w:1/log+:C:\tools\replication.txt</mtps:InstrumentedLink><br /><br />error is system cant find the path specified<br /><br />ANSWER:<br />The source and destination cannot include filenames, only directory names. To copy a specific file, it must be referenced separately <em>after </em>the destination, but <em>before</em> the options. See robocopy/? for syntax.
Tags :

DeSoto2011
Some real documentation would be nice.
<em>Every</em> file must at some point changed, and must be newer or older than <em>something</em>. These terms must have very specific meaning here. What, exactly? <br /><br /> And as to what extra, "lonely", and "tweaked" files are: good luck guessing if you don't already know. <br /><br />
Tags :

Teufel0
robocopy move ACL
If you want to move a directory with an explicit ACL, <br />you have to take two steps on W2k8, Vista and W7:<br />1 copy the root including ACL: /copy:datso /mir /xd * /xf *<br />2 move the whole thing now: /copy:datso /move /e<br />if Fix274755 is installed, allow inheritable permissions from its parent<br />again and remove previously inherited entries (sorry for this).
Tags : move acl robocopy

Adnan Mousa
Robocopy with NDS Shares
<p>We have recently migrated from Novell, and we used FIM to Synchronize User Logins. But we need to migrate File Shares from the Novel to the DFS that we created on Windows 2008, and we need to maintain all user privileges and access on each folder and file. Can we use the Robocopy with the /sec option to simply copy the entire directory structure, or we have to use other tools? Please advise.</p>

Windows Robocopy
Robocopy performance
When I give /mt option with robocopy, it doesn't print out the performance upon completion. Is there a way to do this?<br />i.e. if I do robocopy c:\src e:\dest, it prints performance/thruput (80MB/s etc.) on completion.<br />Whereas, if I do robocopy c:\src e:\dest /mt:4, it doesn't print out any perf stats....<br /><br />Any ideas???<br /><br />Thanks<br />
Tags : robocopy

AndiMzD
Robocopy does not recognize difference in files and skips copying
<p>Hello,<br />I have used robocopy quite often.<br />Since recently on a windows server 2003 System I wanted to use robocopy to synchronize the changes of one directory to another.<br />The first directory is copied from a new DVD which comes out monthly. And the copy routine checks correctly which files have been changed and which not - it skips the changed files.<br />Then I have a second directory with a differnt name and I try to synchronize the changes from the first directory (which now contains the changes from the new DVD) to the second directory using robocopy (both dirs are on the same server in the same drive).<br /></p> <h3>Robocopy, however, runs thru but does not recognize any changes even though files in the first directory have different time stamps and also partly at least different file sizes.<br /></h3> <p>How come? What is going wrong here?<br />Robocopy summarizes like this:<br />Total Copied Skipped<br />Dirs 3939 0 3939<br />Files 58282 0 58282<br />Bytes 5.444g 0 5.444g<br /><br />All files are recognized the same even though they are not. I did use the Mirror switch /mir.<br /><br /><strong>Would anybody have an idea of what is wrong?<br /></strong><br />Sincerely <br />Andreas</p>
Tags :

William Sproule - MSFT
How can I make the Source the "local directory"?
I'm creating an CD containing a variety of files and and apps to install at our Customer Sites. The first thing we do is copy *.* to C:/Temp. However I can't figure out a way to make the Source Directory simply the Local Directory... wildcards are not recognized. Robocopy seems to REQUIRE a path, which is difficult when the CDROM drive letter may be different on each PC, or perhaps the Field Installer will be copying the files over from a Thumb Drive. Help!<br /><br />Beck1234,<br /><br />I believe you can use the '.' character for the local directory. e.g. ( robocopy . "c:\mydestination" "filetocopy" )<br /><br />[ws] assuming you are writing a batch file (text file with .cmd or .bat extension) you can use %~dp0 when you want the fully qualified path to the batch file itself. d for drive, p for path. It will end in a trailing backslash \, so to reference a file in the same directory as your batch file you'd do %~dp0MyOtherFile.ext or a file in a sub-folder as %~dp0SubFolder\MyFile.ext
Tags :

MAK3210
How do you you handle paths with spaces or hyphens?
<p>I run:<br /><br />robocopy "E:\Transfer\PPM\2010\R1.01\AutoProv\" "E:\Utility - ProvisioningWebServices\" filename.ext<br /><br />I get:<br /><br />Started : Thu Jul 29 18:31:26 2010<br />Source - E:\Transfer\PPM\2010\R1.01\AutoProv" E:\Utility\<br />Dest -<br />Files :<br />Options : /COPY:DAT /R:1000000 /W:30<br />------------------------------------------------------------------------------<br />ERROR : Invalid Parameter #2 : "-"<br /><br />I run:<br /><br />robocopy E:\Transfer\PPM\2010\R1.01\AutoProv\ "E:\Utility - ProvisioningWebServices\" filename.ext<br /><br />I get:<br /><br />Started : Thu Jul 29 18:33:12 2010<br />Source : E:\Transfer\PPM\2010\R1.01\AutoProv\<br />Dest : E:\Utility - ProvisioningWebServices" settings.xml\<br />Files : *.*<br />Options : *.* /COPY:DAT /R:1000000 /W:30<br />------------------------------------------------------------------------------<br />2010/07/29 18:33:12 ERROR 123 (0x0000007B) Accessing Destination Directory E:\Ut<br />ility - ProvisioningWebServices" filename.ext\<br />The filename, directory name, or volume label syntax is incorrect.<br /><br />Is this a bug?<br /><br /><br />No it's not a bug. You just can't use a backslash immediately prior to the quote.<br /><br />Your command line should be:<br />robocopy "E:\Transfer\PPM\2010\R1.01\AutoProv" "E:\Utility - ProvisioningWebServices"<br /><br />or something like that...</p>
Tags :

Drewfus
XP027 Robocopy.doc ?
Robocopy version XP010 download comes with a thorough refererence document.<br /><br />Could this document please receive an update for version XP027 ?<br />
Tags : contentbug

Paul_Hossler
Use Environment Variables
Suggest that environement variables be allowed on the command line and in job files. Should include system set variables (e.g. %APPDATA%) but user created.<br /><br /><br />

Paul_Hossler
/xa:hs seems to work for files, not folders
There are a number of sub-sub-...-folders that are either Hidden or System or both, but the files within are not.<br /> <br />Suggest that /xa: be extended to folders and ALL of their lower level content,<br /> <br />e.g. /xfa:hs would exclude any folder and lower level content that had either Hidden or System attributes, so robocopy "...\AppRoaming\Microsoft\Windows" would not copy Cookies (HS set)

Olivier Faucheux
Format of filename in the /XF tag
The XF tag enable to "excludes files that match the specified names or paths". But how to enter the filename with it path?<br />Should I enter the path of the source, or the one of the destination? A little test with:<br /> robocopy C:\src C:\dest <br /> and /XF C:\src\dir\test.txt <br /> or /XF C:\dest\dir\test.txt<br />give the following table:<br /><pre> src present dest present both present<br />src excluded <b>nochange </b>deleted <b>nochange</b><br />dest excluded copied <b>nochange </b>overwritten<br />none excluded copied deleted overwritten<br /></pre><p><br /></p><p>This means that you should exclude the destination path for avoiding change if the file exists in the destination and not in the source. <br /></p><p><br /></p><p>If the src is present, you should however include the source path: include only the destination path will not work!</p><p><br /></p><p>I wish Microsoft give some more information about the working algorythm of the /XF and /XD parameters.<br /></p>
Tags : contentbug

BriarLapin
How to hold the Data Modified with file folder
<p>I used robocopy to copy date from E driver to C driver. But I found I just can hold the "Date Modified" with <strong>file</strong>(display the old date), all the "Date Modified" with <strong>File Folder</strong> have been changed(display the new date). The command is : robocopy e:\ c:\ /e /copy: DATSOU ,anybody have idea to help me? Thanks!<br /><br />Use the /dcopy:T switch to copy directory time stamps</p>
Tags :

Jason Andersen
ROBOCOPY /SD command does not work
<p>When I add the /SD command, ROBOCOPY seems to interpret it the same as the /S command. It certainly isn't creating junctions for me instead of copying their contents.</p>
Tags : bug robocopy

Page view tracker