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
22
votes
2 answers

How to robocopy subfolders with content and files with a specific prefix

It is hard to believe but I seem to be not able to copy a folder with all its files (that begin with a certain character) and subfolders (beginning with the same character) to another folder in Windows 7. I used copy, xcopy and robocopy but all I do…
Largo
  • 487
  • 1
  • 5
  • 17
21
votes
2 answers

How can I copy network files using Robocopy?

How can I copy network files using Robocopy?
gyanesh
20
votes
7 answers

avoid existing file details of destination folder in Robocopy log

I would like to avoid all existing file names and details of destination folder while using Robocopy Log. Just want to show only copied file list and its details. So i could save on the robocopy log file size by avoiding existing file details on…
Josh
  • 1,009
  • 2
  • 13
  • 25
17
votes
4 answers

.Net library to move / copy a file while preserving timestamps

Does anyone know of a .Net library where a file can be copied / pasted or moved without changing any of the timestamps. The functionality I am looking for is contained in a program called robocopy.exe, but I would like this functionality without…
bulltorious
  • 7,769
  • 4
  • 49
  • 78
17
votes
3 answers

Robocopy copy contents of current folder

How would you translate this xcopy command into Robocopy: xcopy *.* "C:\DestinationFolder\" Keeping in mind that the current folder where the command is run changes dynamically (and hence the source folder is unknown in advance). Thanks.
joerage
  • 4,863
  • 4
  • 38
  • 48
17
votes
1 answer

Why does robocopy retry 1000000 times?

I got a couple of legacy batch scripts used for file synchronization. They use robocopy. According to the documentation, by default, there's a retry mechanism : one million retries, 30 seconds between retries. So, if I understand well, if something…
irimias
  • 321
  • 1
  • 2
  • 6
15
votes
6 answers

File copy using robo copy and process

I am creating a File copy program which will copy large number of files(~100,000) with size ~50 KB using ROBOCOPY command. For each file, I am creating a new process and passing the ROBOCOPY command and arguments as follow: using (Process p = new…
Biju Thomas
  • 1,079
  • 3
  • 14
  • 27
15
votes
4 answers

Robocopy - exclude a lot of directories

I have problem with robocopy. I want to use it for backing up a system disc and I want to exclude some system folders. But it's still trying to copy some of these folders. My batch file is this: robocopy c:\ l:\C\ /r:1 /w:1 /mir /dcopy:T /xjd /xjf…
Shortik
  • 175
  • 1
  • 1
  • 9
15
votes
4 answers

run robocopy bat to copy entire drive to another drive

I'm trying to run a simple backup (mirror) of one entire drive (d:) to another drive (k:). I've created a .bat file ('backup.bat') defining the source (d:) and destination (k:) and placed this batch file within a folder on the d drive (d:\temp).…
cherrytree
  • 1,561
  • 3
  • 16
  • 33
13
votes
6 answers

ROBOCOPY - Copy folders content to a single folder

Here is some code I made :) @echo off set source="R:\Contracts\" set destination="R:\Contracts\Sites\" ROBOCOPY %source% %destination% *.srt *.pdf *.mp4 *.jpg /COPYALL /R:0 /S for /r %source in (*) do @copy "%destination" . R:\Contracts\ is full of…
Arthor
  • 666
  • 2
  • 13
  • 40
12
votes
4 answers

Robocopy - /XA:SH - to exclude system, hidden directories?

It seems to only work on files. Or am I doing something wrong? I tried backing a user folder (C:\Users\XXX) in Vista, which has a bunch of hidden/system folders. I used /XA:SHT The folder 'AppData' is 'hidden' but NOT 'system', so it was not…
mcu
  • 3,302
  • 8
  • 38
  • 64
12
votes
2 answers

Robocopy fails when is used from TFS Builds

I set a Command Line phase in a TFS Builds to execute a Robocopy and it returns an error code 1, although there are no errors during the robocopy execution. If I run the Robocopy command directly in the Cmd it works, and the Job log shows that the…
toscanelli
  • 1,202
  • 2
  • 17
  • 40
12
votes
9 answers

Batch - Converting variable to uppercase

How would I go about changing the destl variable to uppercase before it is used. I assume some sort of character swap, however I couldn't get it working. Code is as follows - @echo off echo. set /P "destf=Enter First Name: " set /P "destl=Enter…
Joshua Patterson
  • 433
  • 1
  • 4
  • 15
12
votes
1 answer

Copy only existing files with robocopy

a service is running on many servers and on some machines I need another set of plugins than on other machines for this service. On all those hosts there is already the folder with some plugin files needed for that host. Now I need to update those…
meilon
  • 693
  • 1
  • 6
  • 20
11
votes
4 answers

Powershell with Robocopy and Arguments Passing

I'm trying to write a script that uses robocopy. If I were just doing this manually, my command would be: robocopy c:\hold\test1 c:\hold\test2 test.txt /NJH /NJS BUT, when I do this from powershell, like: $source = "C:\hold\first…
weloytty
  • 5,808
  • 5
  • 28
  • 35
1
2
3
66 67