After wrote an article about copy command, I want write article about xcopy article this time. Copy and xcopy commands have the same function are copy a single file or multiple files to a destination. Compared with copy command, xcopy command has more parameters, so with those added parameters you can make more complex copying command.

So, if you don't satisfy with copy command, instead use xcopy command.
Use xcopy command with this syntax : xcopy [source] [destination] /parameters.
And here are the parameters list:

  • /p : if you use this parameter, everytime the destination file will written, you will prompted.
  • /c : the interpreter will continue even the xcopy command encounters errors while the files being copied. By default, if the command get an errors for during progress copying, the interpreter will stop the xcopy progress.
  • /w : this parameter will makes you'll prompted before the copying progress begin with message : Press any key to begin copying file(s), so the user allowed to insert the flash disk or floppy.
  • /v : like copy command, this parameter to verify every copied file.
  • /q : this parameter to suppress the display of xcopy command messages. The messages contain filenames that are being copied.
  • /f : to display full path of source and destination files during xcopy progress. By default, xcopy display the filenames only.
  • /l : To display a list of file that are to be copied, but actually the files are not copied.
  • /g : to store files in a decrypted state at the destination. You can use this parameter when the destination does not support encryption.
  • /d:[MM-DD-YYYY] : used to copy only those files that have changed since the specified date in MM-DD-YYYY date format. The older files do not be copied.
  • /u : To copy files from source which the files are already exist in the destination.
  • /s : this parameter will copy all subdirectory inside your current directory, but the empty directory doesn't copied.
  • /i : with this parameter, xcopy will check the existing destination folder, if it doesn't exist xcopy will prompt you to created it.
  • /e : like /s parameter, this parameter will copy all files including the sub directory and the empty sub directory will copying too.
  • /t : this parameter will makes xcopy copy the folder structure only and the files don't copied.
  • /k : this parameter to retain the read-only attributes of files and directories after the progress have finished. By default, xcopy will remove read-only attribute.
  • /r : to copy the source files to read-only destination directory. By default, xcopy will skips if the destination folder has read-only attribute.
  • /h : to copy the source files which have hidden attributes. By default, xcopy will ignore the hidden files.
  • /o : to copy the ownership and discretionary access control list information with your files.
  • /n : this parameter will change your long filenames source files to 8.3 format.
  • /x : to copy the system access control list and audit settings of the source files.
  • /a : this parameter used to copies only those files that have their archive bits set. It does not change them.
  • /m : this parameter is contrary with /a parameter.
  • /exclude filename1 + filename2 : to exclude a file or a list of files from copying progress.

These are the examples of xcopy :
xcopy my*.* c:\data /d:08-13-2007, this command will copy all files that have suffix filenames my and have changed since 08-13-2007 to c:\data folder.

So, you can compare copy and xcopy commands and then choose it...

0 comments