Questions tagged [robocopy]

ROBOCOPY.exe - "Robust File Copy" is a Windows command line file & directory replication utility published by Microsoft.

ROBOCOPY.exe

Robust File Copy is a Windows command line file & directory replication utility published by Microsoft.

It is included with Windows Vista & later versions & is available for download for older versions of Windows as part of the Windows Server 2003 Resource Kit Tools.

References:

900 questions
119
votes
9 answers

How can I make robocopy silent in the command line except for progress?

I'm using robocopy to do backups with a PowerShell script, and it's pretty awesome, except that I'd like it to only show the progress percentage while it copies and not all of the other information. The other information clutters the command window,…
AndrewL
  • 2,676
  • 5
  • 25
  • 31
111
votes
15 answers

How to copy a directory structure but only include certain files (using windows batch files)

As the title says, how can I recursively copy a directory structure but only include some files. E.g given the following directory structure: folder1 folder2 folder3 data.zip info.txt abc.xyz folder4 folder5 …
M4N
  • 90,223
  • 44
  • 210
  • 255
110
votes
1 answer

What is Robocopy's "restartable" option?

robocopy /Z = "copy files in restartable mode". What does this option do? All the documentation I've found simply quotes the on-board manual. What is "restartable" mode, why would someone use it, and how does it differ from "Backup mode" (/B) ?
user2279887
  • 1,141
  • 2
  • 8
  • 7
104
votes
12 answers

Copy files without overwrite

I just can't seem to find a way on the command line to say "copy all the files from directory A to directory B, but if the file already exists in directory B, don't overwrite it, no matter which file is newer, and don't prompt me." I have been…
Tony
  • 1,121
  • 2
  • 10
  • 6
43
votes
1 answer

How to use robocopy to copy directories on different domains

I want to copy a directory(abc) from domain1/user1 to domain2/user1. any idea how to do this. e.g robocopy robocopy \\server1\G$\testdir\%3 \\server2\g$\uploads and both are on different domains
sam
  • 4,388
  • 10
  • 56
  • 109
37
votes
2 answers

How to display percentage complete in Robocopy?

Is there a way to show the percentage completed in Robocopy? I am running with /NDL and /NFL, but I would like to see the overall percentage... is this possible?
MrDuk
  • 12,340
  • 13
  • 55
  • 113
34
votes
7 answers

Using robocopy with Visual Studio 2010 Post-build and Pre-build events

Robocopy outputs 1 upon success, unlike most programs that exit with 0 on success. Visual Studio (and MSBUILD) interprets exit code of 1 as an error. How can Robocopy be used in Visual Studio post- and pre-build events such that its failure and…
Asaf R
  • 6,580
  • 8
  • 41
  • 64
34
votes
3 answers

How to copy files from folder tree dropping all the folders with Robocopy?

I have the following folder structure: FolderA --Folder1 --Folder2 --Folder3 ... --Folder99 Folders 1 through 99 have files in them. All I want to do is to copy ALL THE FILES into ONE FOLDER, basically do a FolderA copy, and wipe out Folders 1-99…
roman m
  • 24,529
  • 27
  • 98
  • 131
27
votes
3 answers

Use Robocopy to copy only changed files?

I'm trying to find an easy way of deploying only changed files to the webserver for deployment purpose. In times past I've used MSBuild, which could be told to only copy files that were newer than the ones on the target, but I'm in a hurry and…
Cyberherbalist
  • 11,515
  • 15
  • 77
  • 119
26
votes
3 answers

How do I force Robocopy to overwrite files?

In general, Robocopy ignores files for which lastwrittendate and filesize are the same. How can we escape this design? I'd like to force overwriting with Robocopy. I expected that dst\sample.txt should be written test001. But these file are…
tbl
  • 623
  • 1
  • 7
  • 11
24
votes
8 answers

How to copy directories with spaces in the name

I am trying to use robocopy but am unable to make it work because of spaces in the directory names. I am trying to copy 3 directories: My Documents, My Music and My Pictures to 'C:\test-backup' but want the end result to be 'C:\test-backup\My…
Angie
  • 721
  • 2
  • 6
  • 18
23
votes
6 answers

How to exclude subdirectories in the destination while using /mir /xd switch in robocopy

There is a script running which mirrors a bunch of folders from one volume to another. The problem is that now there are going to be subdirectories within those folders at the destination which are not part of the original mirroring script. They are…
Umang M
  • 241
  • 1
  • 3
  • 4
22
votes
1 answer

What attributes does "[RASHCNET]" refer to?

In some of Robocopy options like: /a+:[RASHCNET] - Adds the specified attributes to copied files. /a-:[RASHCNET] - Removes the specified attributes from copied files. What attributes does [RASHCNET] refer to?
Sajal
  • 1,583
  • 1
  • 13
  • 17
20
votes
3 answers

Jenkins - simply robocopy in Jenkins finishes marks build with failure

I have a simply windows batch command (robocopy) that returns zero errors but is always marked as a failure in Jenkins. I would like to know why? D:\Jenkins\jobs\Jenkins Config Backup\workspace>exit 1 Build step 'Execute Windows batch command'…
user2860244
  • 261
  • 1
  • 3
  • 4
19
votes
2 answers

How can I copy network files using Robocopy?

How can I copy network files using Robocopy?
gyanesh
1
2 3
60 61