Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Robocopy copy contents of current folder

Tags:

robocopy

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.

like image 419
joerage Avatar asked Jan 13 '11 16:01

joerage


People also ask

How do I copy an entire folder in Robocopy?

The easiest way to copy a folder with all files and subfolders is to run this command: robocopy c:\temp\source c:\temp\destination /E /DCOPY:DAT /R:10 /W:3. The /E switch tells Robocopy to copy all subfolders, including empty ones. If you don't want to copy empty subfolders, use the /S switch.

Does Robocopy copy existing files?

Excludes existing files with the same timestamp, but different file sizes. Source directory files newer than the destination are excluded from the copy. Source directory files older than the destination are excluded from the copy. Excludes extra files and directories present in the destination but not the source.

What is Copyall in Robocopy?

Source Options /S - Copy subfolders. /E - Copy subfolders including empty folders (useful for recreating a folder structure) /COPYALL - Copy all file info, such as attributes and timestamps. /MAXAGE & /MINAGE - Use these to filter the file ages, either maximums or minimums.

Is Robocopy faster than XCopy?

The average Disk Read Transfer is better for XCopy (76.15 MB/Sec vs. 75.28 MB/Sec), the minimum Disk Read Transfer is better for Robocopy (4.74 MB/Sec vs. 0.00 MB/Sec) and the maximum Disk Read Transfer is better for XCopy (218.24 MB/Sec vs. 213.22 MB/Sec).


1 Answers

robocopy . "c:\dest"

Note you don't need to specify a wildcard in robocopy, by default it copies everything unless you use the /xf /xd flags to exclude certain files.

like image 53
Martin Beckett Avatar answered Oct 21 '22 03:10

Martin Beckett