Questions tagged [robocopy]

Robocopy is a command line file copy utility for Windows-based operating systems.

Robocopy is a Microsoft command line file copy utility that is built into Windows Server versions 2008 R2 and newer. Examples of basic functionality include directory mirroring, copying files over a network, restartable copy and multiple exclusion/inclusion flags.

272 questions
129
votes
4 answers

robocopy transfer file and not folder

I'm trying to use robocopy to transfer a single file from one location to another but robocopy seems to think I'm always specifying a folder. Here is an example: robocopy "c:\transfer_this.txt" "z:\transferred.txt" But I get this error…
Bill McKay
34
votes
8 answers

How to get robocopy running in powershell?

I'm trying to use robocopy inside powershell to mirror some directories on my home machines. Here's my script: param ($configFile) $config = Import-Csv $configFile $what = "/COPYALL /B /SEC/ /MIR" $options = "/R:0 /W:0 /NFL /NDL" $logDir =…
Mark Allison
  • 2,098
  • 7
  • 26
  • 45
30
votes
2 answers

What switches can robocopy use to preserve file and directory times on the target?

After using robocopy to copy files to a new drive I realized that all the file and directory creation times and been reset to the time of copying. Are there some switches to make robocopy keep the original files times?
vfclists
  • 1,562
  • 5
  • 20
  • 36
27
votes
11 answers

Robocopy: How to move the content of a directory but KEEP the directory

Simple task: Move all the content of the directory c:\Users\files\Desktop\test 2 to c:\Users\files\Desktop\test 1 C:\admin\temp>robocopy "c:\Users\files\Desktop\test 2" "c:\Users\files\Desktop\test" *.* /S /MOVE Sounds reasonable, but now, the…
perler
  • 421
  • 2
  • 6
  • 10
25
votes
4 answers

Can Robocopy be made to skip open files?

We are using Robocopy to redistribute files which arrive via FTP in a drop folder. Ideally we want Robocopy to leave files alone if they are still being FTPd. Having tried various switches, Robocopy still copies the open files. It doesn't delete…
domspurling
  • 253
  • 1
  • 3
  • 5
23
votes
1 answer

robocopy is 20x slower than drag/droping files between servers

I am migrating 20TB of files between two servers. Both systems are Windows 2012R2 with latest updates installed. Both using gigabit network. Using robocopy on the new server with the command line robocopy /S /ZB /MOVE /J /DCOPY:A /V /FP…
Grant
  • 17,671
  • 14
  • 69
  • 101
23
votes
8 answers

The Job and Monitoring Options of RoboCopy

What does the Job Options of RoboCopy do? And what exactly does the /MON and /MOT switches do? How can I use them? I don't understand them, and can't find any examples on how to use them. /MON:n - MONitor source; run again when more than n changes…
Svish
  • 6,627
  • 14
  • 37
  • 45
20
votes
3 answers

On Windows: is it safe to do a robocopy in order to clone the system?

Let me start by giving a bit of a background. On Linux systems, I frequently rely on the fact that as long as I can get all files over from one hard drive to another, and as long as I fix up the boot loader, I'll be left with an identical,…
ixnaum
  • 203
  • 1
  • 2
  • 4
20
votes
4 answers

Wildcard directory exclusions with robocopy -- weird case

I need to get robocopy to exclude any file whose path contains a directory with a particular name. For example, "bar": c:\foo\bar\a.txt c:\bar\c.txt d:\baz\bar\flub\d.txt should be excluded, but not c:\foo\barf\b.txt Here are the things I tried --…
Jesse
  • 1,910
  • 3
  • 23
  • 28
18
votes
1 answer

User accidentally messed up a Robocopy command and caused a bunch of folders to get created with corrupt security

We had a user run a robocopy command to copy some files but unfortunately the user accidentally messed up the syntax. Something like: robocopy "\\server1\share\Accounting" \\server1\share\NewAccounting" /E /X /COPYALL /TEE Which without the proper…
TheCleaner
  • 32,352
  • 26
  • 126
  • 188
15
votes
3 answers

Exclude only some files with the same name when copying using robocopy

I have a directory structure like this: folder1\ help.txt folder2\ help.txt folder3\ help.txt ... I want to copy the contents of folder1 using robocopy. For example: robocopy folder1 destination /E I want to exclude…
Daniel Richardson
  • 338
  • 1
  • 2
  • 7
14
votes
1 answer

What is a S-X-X-XX-XXXXXXXXXX-XXXXXXXXXX-XXXXXXXXX-XXXX called in Windows security?

I copied two trees, a source and a destination, that I copied with robocopy like this: robocopy /MIR C:\Windows\System32\tasks\ C:\temp\robocopyTasks\out\ robocopy /E /Copy:S /IS /IT C:\Windows\System32\tasks\ C:\temp\robocopyTasks\out\ Then I…
leeand00
  • 4,807
  • 13
  • 64
  • 106
13
votes
5 answers

Apparently Robocopy does not understand Windows Server 2016 deduplication. Is there a way to make it work without corrupting the volume?

Scenario: Doing a server migration from old Server 2008 R2 to new Server 2016, following this Server Fault guide: File server migration using Robocopy After Robocopy completes, enable deduplication on Server 2016 for the copied volume, and then use…
Dale Mahalko
  • 725
  • 1
  • 6
  • 16
13
votes
4 answers

How do I get robocopy to use a log file which includes spaces?

I'm trying the following command: robocopy "x:\dir" "y:\dir" /mir /z /tee /fft /nfl /ndl /eta /log:"x:\path to logs\12-15-11 01 file with spaces.txt" I'm getting this error: ERROR : Invalid Parameter #10 : "/log:x:\path to logs\12-15-11 01 file…
slm
  • 7,355
  • 16
  • 54
  • 72
12
votes
3 answers

How do I use robocopy with a large number of excluded files?

I want to use robocopy to move a large number of files, except those that are in a whitelist. The whitelist contains approximately 150 files of different names. When I copy-and-paste the whitelist's filenames into the command line (using the /xf…
1
2 3
18 19