Copying Files in Microsoft Windows
Contents
MS-DOS
Copying a single file from one location to another
copy foo.txt c:\my\location
Once in the directory that contains the files you want to copy, type a command
copy *.* c:\mydir
If you need to copy files, directories, and subdirectories use the xcopy command.
xcopy foo example /e
Windows Command Shell
To bring Cmd.exe into conformity with the Microsoft MS-DOS 6.x and Microsoft Windows 95 command shells (Command.com), Microsoft has added support for overwrite warnings. When you are copying or moving files from one location to another, if the files already exist in the destination folder, you receive an "overwrite" warning that prompts for confirmation before overwriting the file.
This behavior is controllable with the /y switch.
Are you sure you want to copy this file without its properties?
Trying to copy files from the system to removable media such as a USB flash drive and Microsoft prompts an annoying and reoccurring error message. The message is vague and misleading. It relates to NTFS ADS (alternate data streams).
The NTFS file system is inappropriate for flash media. FAT32 is not capable of preserving the NTFS permissions of files being copied from the NTFS formatted hard drive to the FAT32 removable media. The permissions largely include file ownership and file permissions. These are not file "properties" but rather file "permissions."
Even when you select YES to the dialog and check the box for application of the selection to all files, it only applies to files of the specific type. For a different file type the dialog will present itself again. This makes a "fire and forget" unattended file copy process impossible.
Microsoft suggests formatting the removable media NTFS, which is ill-advised. Due to the additional read/write activity necessary for NTFS this would not be good for flash media. NTFS is also less portable. The best solution would be to have the ability to copy without the annoying prompts.
Workarounds / Solutions: (1) Using the command prompt and piping Y for yes. (2) Using third party copy software such as TeraCopy. (3) Getting angry and waiving your fist in the air while damning Microsoft.
Example has f as the removable media. Open the command shell cmd.exe with administrator privileges.
xcopy c:\files f:\ /s/h/r/i/k/e/y
or
robocopy c:\files f:\ /e /b /copyall /xo /it
Copy a lot of files while not stopping for errors / ignore errors
The traditional way using xcopy from console
xcopy $SOURCE $DESTINATION /C /E /Q
The /C flag forces xcopy to ignore any issues with copying; the /E flag orders xcopy to copy folders (even empty ones), and the /Q flag makes it a quiet operation (otherwise, you'll get an entry for each thing copied).
example:
xcopy d:\*.* c:\recovery /C /E /Q
The new way using robocopy on Windows 7
Robocopy stands for "Robust File Copy." Robocopy functionally replaces Xcopy, with more options. It has been available as part of the Windows Resource Kit starting with Windows NT 4.0, and was first introduced as a standard feature in Windows Vista and Windows Server 2008. The command is robocopy.
Robocopy CAN copy all NTFS file attributes.
robocopy c:\ d:\ /MIR /R:0 /W:0
/MIR = Mirror entire directory structure (can use /E instead) /R:0 = 0 retries for read/write failures /W:0 = 0 seconds between retries
Recovering files from bad harddrive.
robocopy E:\source-path\folder\ C:\destination-path\folder /MIR /R:0 /W:0
Robocopy GUI
Robocopy is in Resource Kit Tools. Robocopy is command line in console (MS-DOS emulated command shell). For a GUI version use Robocopy GUI developed by Derk Benisch, a systems engineer with the MSN Search group at Microsoft. Robocopy GUI also extends the functionality of the existing Robocopy tool in some very interesting ways. For example, this tool is multithreaded, allowing you to create a Robocopy script, execute it, and begin creating another one while your first script is still running. It also allows you to save your scripts (even if you don't actually execute them) so that you can create a library of common scripts or share them with your colleagues. And most importantly, Robocopy GUI allows you to save your default settings so you don't have to start from scratch every time.
Robocopy GUI in the downloads section of Microsoft TechNET.
source: Utility Spotlight Robocopy GUI
RichCopy replaces Robocopy GUI
RichCopy offers a number of granular controls that allow you to tailor file copying to your needs