If we have a successful build on our build server (CCNET) all ASP.NET website files are copied to the virtual directory (%output_dir%) so non-developers can see/test the latest version of the website. At the end of the build the following bat file is executed.
rmdir /s /q "%output_dir%"
mkdir "%output_dir%"
xcopy "%source_dir%*" "%output_dir%" /e /c /i /q /-y
The problem is I find the copying slow and was wondering if there are any copy commands available in Windows 2008 that are faster than xcopy? The source and destination are on the same drive. Below are the arguments we use when copying.
/e = copies directories and sub directories including empty ones.
/c = continues copying even if there are errors
/i = if destination does not exist destination is directory
/q = don't display filenames
/-y = confirm overwrite
Best Answer
From a performance standpoint only, xcopy or robocopy will give you similar results. I ran through a couple of tests on a Windows Vista 64-bit SP2 box to do some comparisons. All copies were performed between a internal 7200 RPM Sata II disk and an external USB 2.0 drive or on the same internal drive itself where indicated. No special setup was done (make up your own mind if that invalidates/validates the test), only to input the command into a batch file to execute. PowerShell was used to capture the start and stop times. After a couple of passes here are the averages from the tools I played with:
File: 732,909,568 bytes (698 MB), 1 ISO file copied to different directory on the same internal disk.
File: 732,909,568 bytes (698 MB), 1 ISO file copied to external USB disk.
Files: 45,039,616bytes (42.9MB) 5 random files copied to external usb disk
Files/directoies: 1,087,180,800 bytes (1.01 GB), 27 files/8 directories copied to external USB disk.
This is by no means an exhaustive test, but just throwing a quick real world scenario at some of the more popular tools in this genre shows that your pretty safe sticking with either xcopy or Robocopy (from a performance standpoint only). Also the Robocopy option
/NP
(No Progress) saves you 0 time. That doesn't mean you cannot benefit from using something other than xcopy however. Robocopy is a great example (from Wikipedia):Robocopy is notable for capabilities above and beyond the built-in Windows copy and
xcopy commands, including the following: