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:

1005 questions
144
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
  • 3,126
  • 5
  • 31
  • 33
126
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
  • 94,805
  • 45
  • 217
  • 260
120
votes
14 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,281
  • 2
  • 11
  • 6
114
votes
2 answers

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,191
  • 2
  • 8
  • 7
47
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,594
  • 12
  • 61
  • 111
46
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
  • 823
  • 1
  • 8
  • 11
46
votes
3 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
  • 16,578
  • 18
  • 74
  • 133
40
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
  • 871
  • 2
  • 10
  • 18
36
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,880
  • 9
  • 47
  • 69
34
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
  • 12,061
  • 17
  • 83
  • 121
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
  • 26,012
  • 31
  • 101
  • 133
30
votes
5 answers

After Robocopy, the copied Directory and Files are not visible on the destination Drive

I've been happily using robocopy for backing up my computers to an external usb drive. It's great since it only copies the files that were changed/updated/new. I can take my external drive to any machine and look at it just as if it's another drive…
Bill Campbell
  • 2,413
  • 6
  • 27
  • 32
29
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
  • 301
  • 1
  • 4
  • 4
25
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,783
  • 1
  • 17
  • 21
24
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
  • 301
  • 1
  • 3
  • 4
1
2 3
66 67