Monday 21 October 2013

How to copy files using command prompt



  • To append files to one another you can specify multiple source files with one destination file. 
  • Example:
               "copy c:\texts\part1.txt+part2.txt+part3.txt" would combine the contents of all three files into the file part1.txt                                                          

    • To copy all files you can use a * wildcard character such as "copy c:\Folder1\*.* c:\temp\". This will copy      all files from C:\Folder1 to C:\temp\                               
    • The proper format of a copy command is: COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]]           [destination] [/A | /B]] [/V] [/Y | /-Y]                                           

    1. source Specifies the file or files to be copied.
    2. /A Indicates an ASCII text file.
    3. /B Indicates a binary file.
    4. destination Specifies the directory and/or filename for the new file(s).
    5. /V Verifies that new files are written correctly.
    6. /Y Suppresses prompting to confirm you want to overwrite an existing destination file.
    7. /-Y Causes prompting to confirm you want to overwrite an existing destination file.