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

msbuild fails with successful robocopy exit code

My msbuild script fails even if copying files is successful. If robocopy command exitcode < 8, it means that files copied. So how can I say to msbuild script IgnoreExitCode if exit code < 8? I set IgnoreExitCode to true, but what if it's real…
zampotex
  • 317
  • 4
  • 9
5
votes
2 answers

robocopy treats options as files

When i use robocopy to copy a file and use the option /IS to overwrite if already present at the destination. It treats the option as another file as can be seen by the logs: ERROR : Invalid Parameter #4 : "C:/Program Files/Git/IS" Anybody knows how…
Priyesh
  • 51
  • 2
5
votes
5 answers

How can I get unicode characters from robocopy process standard ouput in c#

Our application runs various actions and displays the output in a log window. One action uses robocopy to copy files between folders. This works ok until the robocopy output contains unicode characters. I understand that I need to use the /unicode…
sparkplug
  • 1,317
  • 2
  • 15
  • 32
5
votes
0 answers

Copy Files in Visual Studio Post Build Event

I want to copy all files recursivly with given file extensions after the build process succeeds. Robocopy ROBOCOPY %source% %destination% /S *.as?x *.xls? *.mrt xcopy xcopy .\*.as?x %destination% /SY xcopy .\*.xls? %destination% /SY xcopy .\*.mrt…
Marko
  • 1,291
  • 1
  • 21
  • 37
5
votes
2 answers

Why a folder name is different in Windows Explorer than command line or cygwin?

I have been using Robocopy to backup my computer files. I have been using the following command: robocopy C:\Users\ J:\backup\ *.* /a /XD AppData /XJD /R:0 /s When I look into my J drive in Windows Explorer I see folder named J:\Users\ but when I…
rjss
  • 935
  • 10
  • 23
5
votes
2 answers

Get/set file attributes in PowerShell when the path\filename is longer than 260 characters

I am looking for a way to get and set file attributes (hidden and readonly) in PowerShell for files where the combined path and filename are longer than 260 characters. I know that the .NET classes don't support longer file paths; I've already tried…
Benjamin Hubbard
  • 2,797
  • 22
  • 28
4
votes
2 answers

How to skip existing and/or same size files when using robocopy

I have this code: @echo on set source="R:\Contracts\" set destination="R:\Contracts\Sites" ::Not sure if this is needed ::It guarantees you have a canonical path (standard form) for %%F in (%destination%) do set destination="%%~fF" for /r %source%…
Arthor
  • 666
  • 2
  • 13
  • 40
4
votes
1 answer

Exclude destination files/directories form robocopy?

I have a deploy process that is currently using this robocopy command: robocopy [source] [destination] /MIR /XF [file pattern] /XD [directory pattern] The [destination] may have additional files or directories added to it outside this process that…
theJBRU
  • 797
  • 2
  • 10
  • 20
4
votes
1 answer

how to copy files in use with robocopy?

I am having a batch file performing some backup operations. The backup operations look like this: robocopy %source% %root%\%targetname% /MIR /R:0 /W:0 /NFL /NDL /NJS Unfortunatly some files in use cannot be copied due to windows "protection". Is…
Steven
  • 61
  • 1
  • 3
  • 10
4
votes
1 answer

Robocopy with exclusion list

I'm trying to use ROBOCOPY to move all files, folders, and subdirectories from one location to another. There are some files that SHOULD NOT be moved. I want to store a list of these files that are NOT to be moved in a text file. What syntax would…
The_BMan
  • 105
  • 11
4
votes
9 answers

Using Robocopy to deploy sites

I want to be able to quickly deploy updates to a site that is fairly busy. For smaller sites I would just FTP the new files over the old ones. This one, however, has a few large dll's that regularly get updated and while they are copying the site is…
William Hurst
  • 2,231
  • 5
  • 33
  • 54
4
votes
3 answers

Robocopy to multiple destinations

is it possible and safe to copy from one source to multiple destinations with Robocopy? I mean, something like this in a bat file: ROBOCOPY source dest_1 ROBOCOPY source dest_2 Is there any side effect? Thanks!
andrew0007
  • 1,265
  • 4
  • 18
  • 32
4
votes
2 answers

robocopy + skipping empty files

Is there any way to exclude copying of empty files (0 bytes) using robocopy command? I have a source with thousands of empty files besides other files and destination also have same file names but not empty. I want to copy everything from source to…
user5218171
  • 41
  • 1
  • 2
4
votes
0 answers

robocopy extra files that are not extra

I use a simple robocopy command, meaning robocopy source dest "*.xml" I expect it to copy all XML files that are new or were modified (different time stamp or size) to dest. And it is exactly what robocopy does, however, robocopy recognize all the…
yasio90
  • 41
  • 1
  • 4
4
votes
1 answer

RoboCopy - Files starting with a dash result in error

We are in the process of migrating files from one share to another. We have built a tool in which the user can select directories and/or individual files to be copied to a destination share. The tool generates an individual RoboCopy command for each…