Robocopy (or "Robust File Copy") is a command-line directory replication command.

learn more… | top users | synonyms

38
votes
7answers
23k views

Getting ROBOCOPY to return a “proper” exit code?

Is it possible to ask ROBOCOPY to exit with an exit code that indicates success or failure? I am using ROBOCOPY as part of my TeamCity build configurations, and having to add a step to just silence ...
33
votes
2answers
39k views

What does robocopy mean by tweaked, lonely and extra?

The robocopy documentation for the option /it is simply Includes "tweaked" files. What does tweaked mean? The robocopy documentation for the option /xl is simply Excludes "lonely" files and ...
20
votes
2answers
21k views

Linux equivalent to robocopy?

It's kind of funny, there are a lot of ways in which Linux command line tools are vastly superior to Windows ones, but one thing I have not found an equivalent to is robocopy. Robocopy is way more ...
12
votes
1answer
48k views

Using robocopy and excluding multiple directories

I'm trying to copy some directories from a server before I restore from backup (my latest backup was corrupt, so I have to use an older one :( ). I'm in the Windows Recovery Environment and have ...
9
votes
9answers
10k views

Robocopy does not copy the root folder and its time stamp

Robocopy does not copy the root folder and its time stamp - it copies all subdirectories and files (when the appropriate options are set) and there seems to be no option/argument to tell Robocopy you ...
7
votes
2answers
10k views

What is the benefit of copy over xcopy on the command line?

I know that xcopy has more options however is there some benefit to using copy rather than xcopy?
7
votes
3answers
4k views

delete recursive directory created by robocopy when “The file name is too long”

After running robocopy.exe to backup a C:\Users\ folder without using the /xj switch, I ended up with a recursive directory which was too long. For example, if you run dir /b /s you will receive the ...
6
votes
2answers
1k views

Windows 7 Delete heavily nested folder structure

I was running a node script that went awry and created a folder structure like so: \myfolder \myfolder \file.txt \myfolder \file.txt \myfolder ...
5
votes
1answer
5k views

Robocopy /XD Won't Work With Relative Paths

I am trying to run a robocopy /MOVE command but exclude a couple of sub-directories specified with the /XD flag. robocopy ".\CurrentDir" ".\NewDir" /XD ".\CurrentDir\SubDir1" ".\CurrentDir\SubDir2" ...
5
votes
2answers
15k views

How to copy ONLY those files that are not in the destination?

Is it possible to use robocopy to copy only the files that do not exist in destination? robocopy has a /is (include same files) switch. What I am looking for is an /xs switch. If a file exists in ...
5
votes
2answers
1k views

How to wake a network drive from batch script?

I have a batch script which runs a robocopy. It is failing because the drive is not awake. In windows explorer, doubling clicking on that icon "wakes" up the link and the cross disappears and the ...
5
votes
2answers
7k views

How do I hide “Extra File” and “100%” lines from robocopy output?

I have a robocopy script to back up our Kiln repositories that runs nightly, which looks something like this: robocopy "$liveRepoLocation" "$cloneRepoLocation" /MIR /MT /W:3 /R:100 ...
4
votes
4answers
3k views

Robocopy unilog output is gibberish

I tried to get robocopy in Windows 7 to generate a Unicode log, since I have files with Unicode characters. The command I used: robocopy C:\mysource D:\mydest /mir /unilog:backup.log /tee File the ...
4
votes
2answers
16k views

How to copy only new files AND only those that are modified after a certain date?

I would like to copy files from one drive to another, but I only want to copy source files that are newer than the destination file. BUT, I also want to only copy source files that have been changed ...
4
votes
2answers
14k views

How to robocopy with progress logged to console only?

I want to run RoboCopy that will update the console with % progress but not clutter the log file with % progress. The following RoboCopy command will perform the desired copy and append logging ...
3
votes
7answers
3k views

Incremental/Differential Backup on Windows

What's the easiet way to perform an incremental/differential backup to a network share in Windows? Does a Robocopy/Xcopy solution work reasonably well (I need to the parameters!) or is there a good ...
3
votes
1answer
58 views

Does robocopy make a local copy of the files?

I have a seagate NAS which I access over a shared folder. I also have 3 computers with a shared folder. I want to backup files from the 3 computers to the seagate NAS. I cannot run those tasks with ...
3
votes
5answers
10k views

Robocopy permission denied

Robocopy is preinstalled with Windows 7. I've used it many times in the past. I tried to copy a folder to a remote share with robocopy c:\source "\\server\share\path" /s /r:2 /w:2` As a result I ...
3
votes
4answers
2k views

Using Robocopy for file rotation

I am looking for a way to use robocopy to rotate log files. Currently I have a batch file using robocopy to copy files and log the results to a specified folder location. What I would like to do is ...
3
votes
4answers
1k views

Robocopy and fragmentation

While copying large number of files, it's quite often to use multiple threads with RoboCopy (/MT[:n] option). Can this cause fragmentation on the destination drive? Sometimes I use Beyond compare for ...
3
votes
1answer
1k views

ROBOCOPY command to do an incremental backup

I am overwhelmed by the ROBOCOPY documentation. I want to do an incremental backup of my local files to the network drive (M). I want it to run as quickly as possible, with no log file and with as ...
3
votes
1answer
6k views

Robocopy, how to log only errors?

Will the options /nfl /ndl be enough and not exclude errors too?
3
votes
2answers
1k views

Why does Robocopy ignore the /copy flags?

Robocopy Copy Flags? I just recently made an answer here http://stackoverflow.com/a/15211788/891976 where I suggested using robocopy and its /copy flags, but for some as of yet unknown reason, the ...
3
votes
2answers
6k views

How to use Volume Shadows Copy and Robocopy on Win7?

I’d like to backup my system with Robocopy and Powershell, but Robocopy is not able to copy open files. Volume Shadows Copy seems a solution but I can’t find any clear and simple explanation on how to ...
3
votes
1answer
1k views

Robocopy Mirror Backup gone awry

I have created a simple batch file script for running Robocopy. It is set to make a backup of my user account folder to my external hard drive. Here's the parameters for Robocopy: ROBOCOPY ...
3
votes
2answers
236 views

Use OneDrive as additional backup location

I'm trying to take advantage of the fact that OneDrive now offers unlimited space, and allows these files to not take up space locally. I already have a backup system in place, but I would like to add ...
2
votes
4answers
9k views

Does Robocopy Keep a Log File by Default?

I copied a huge number of files using Robocopy, and recived a note at the end that two files failed. I didn't set a switch to save a log file. Is there a log file saved in a default location ...
2
votes
1answer
32 views

Trying to pseudo-sync 2 computers - why folders renamed?

Trying to pseudo-sync 2 computers - why folders renamed? Windows 7 - new computer Vista - old computer I create a new folder OldComputerDesktop in C:\Users\joeblow. I execute this: robocopy.EXE ...
2
votes
1answer
226 views

Robocopy on network as part of a pipeline

I have the following pipeline: [other vendor] sends files to my Windows filesystem, which are indexed starting with the next unused number (normally file.001) I move the files with RoboCopy to my ...
2
votes
2answers
352 views

Are junctions affected if the drive is formatted?

I was trying to relocate my user profiles, so that they are not affected by any problems occuring in the drive on which the operating system is stored. I've managed to move user profiles using ...
2
votes
4answers
6k views

Copy files from FAT32 to NTFS, preserving date

I have a FAT32 flash drive full of old archived emails, and their creation/modification date is important because it represents when the email was received. I'm trying to copy these over to another ...
2
votes
3answers
7k views

Why can't a Task Scheduler job access a mapped network drive?

I have a Task Scheduler job to run Robocopy for backing up local files to a network share. I have to use domain credentials to access the network share but the local computer is not on the domain, and ...
2
votes
2answers
218 views

What is the fastest way to mirror a directory tree on a DVD to a local hard disk in Windows 7

Recently I had DVD with a folder that contained over 83,000 files and folders. When I went to mirror this folder onto a local harddrive with ROBOCOPY I quickly discovered that more than an hour had ...
2
votes
1answer
2k views

Robocopy copy only changed files to new folder

I'd like to create a backup such as the following: C:/backups/20140101/ All files from source folder C:/backups/20140102/ Only files changed since last backup C:/backups/20140103/ Only files ...
2
votes
3answers
6k views

How to optionally copy and rename a file in Windows?

Basically, in an automated batch file, I want to copy and rename a file if the destination file is missing or older. There are several variants, which do not quite work: copy /Y c:\source\a.file ...
2
votes
1answer
131 views

How can I clone a directory structure with symbolic links (in-tact, also duplicated)?

We use Kiln for our source control; and back it up by copying the KilnRepositories folder to another (local) drive while the services are all stopped, and then on to a network drive afterwards (the ...
2
votes
1answer
167 views

Can I prompt a user to save a file using windows explorer?

I'm trying to build a windows batch file that will copy a folder and all its contents from the local user directory into an individually named folder on a shared server. The name of the folder on the ...
2
votes
1answer
680 views

robocopy can’t find newly zipped file for copy

I am working with a batch file that is being used to copy files from several remote servers to one central repository using robocopy. I am trying to zip the contents of a folder and then copy it but ...
2
votes
3answers
948 views

Delete dupe files from source, move only missing across to target in Robocopy

We copied all our files to a new storage server recently. We didn't want to move at the time because we weren't sure if files would get lost. The problem now is that we have files on both places. ...
2
votes
2answers
4k views

How to abort robocopy on first error

When using robocopy windows utility, what flags do I set so that robocopy aborts on the very first error it sees, similar to xcopy /dry command? I need to mirror two dirs, and on occasion some files ...
2
votes
0answers
3k views

ROBOCOPY /MIR (or /PURGE) follows and deletes target symlinks

Let's say we have a folder SOURCEDIR to be synchronized with TARGETDIR. The problem: if TARGETDIR contains directory symlinks, ROBOCOPY /MIR (or /PURGE) will follow the symlink, and delete every file ...
2
votes
0answers
916 views

Batch file to move/compress/delete files

I am trying to write a batch script that will run automatically daily to do the following: Move files older than 2 days to from the main directory (Jason) to an archive directory. Zip files in the ...
2
votes
1answer
2k views

Can Robocopy monitor files on a time incremenet of less than one minute?

Robocopy has the option to monitor the source directory, and copy over any files that have changes. You can specify how many changes in the directory must occur before copying (/mon n where n is the ...
2
votes
0answers
2k views

command line remove read only flag on all subfolder entries or overwrite read only files with robocopy

I need one of two things to work: I use robocopy to copy all sub-files and sub-folders from one folder to another, and the destination contains older files + files not in the source, and I need the ...
1
vote
5answers
798 views

How can I copy files from A to B, only including files that exist in B?

I'm on Windows 7 Professional, and this is my scenario : Folder "Asd" (C:\) Folder "Asd" (D:\) File 1 File 1 File 2 File 3 File 3 ...
1
vote
3answers
4k views

Mirror/Backup from SSH/SFTP to Windows

What I am trying to do is mirror a directory (recursively) from a server I can SSH/SFTP to, to a Windows machine. I want to do this as part of a script, so it can be automated. I only want to copy ...
1
vote
1answer
205 views

Need to create a robocopy in Powershell 1.0

My ultimate goal is to mirror a folder and its subdirectories with the restriction of only copying files with the extensions, sln, vcxproj, cs, cpp, hpp, c, and h. There are far too many subfolders ...
1
vote
2answers
1k views

Copy Files from One Drive to Another and Keep Hard-Link in Windows

I have drive A: with 16G Space and plenty of files, due to the Hard-link feature in NTFS, the files together is 15G but only takes 2G of real space. I like to copy all those files to drive B: which ...
1
vote
3answers
3k views

Robocopy launches and then hangs/just sits there

I'm setting up an archive process to store old files on an external hard drive. The computer in question is running Windows 7 Pro 32bit. We have a server folder with 150,000+ files in it, most of ...
1
vote
2answers
3k views

Batch file, skip a step if an error occurs

I'm trying to write a script that automates copying some files from two external locations using Robocopy. I want the script to skip a step if one of the locations is unavailable. I'm using the ...