How to Copy a File & All Subfolders in DOS


If you have had to troubleshoot or back up files from a failed computer, you are likely to be familiar with the DOS copy command. The copy command creates a copy of a file, or all files in a folder, moving the copy (or copies) to the destination of your choice. However, using the copy command, you must manually copy the files from any subfolders beneath the first. This process is tedious and easy to do incorrectly. Most versions of DOS eliminate this problem by including the \"xcopy\" command, which can copy the contents of a folder and all subfolders beneath it. Use the xcopy command to back up a folder and its subfolders in DOS.

Things You'll Need

  • MS-DOS 3.3 and later
  • Windows 95 and later
  • Type \"cd C:\\" after booting the computer to a DOS prompt or opening a command prompt in Windows. Press \"Enter.\" This command moves you to the root directory of the primary hard drive. If you have already created a folder to transfer files into, skip to Step 3.

  • Type \"md backup\" and press \"Enter.\" This command creates a folder called \"backup.\" This is the folder that the folder structure you are backing up will be copied into.

  • Type \"xcopy /e (source folder)\. (destination folder)\" and press \"Enter.\" The full path to each folder must be used. For example, if the files and subfolders that you wanted to copy were located in \"c:\work\files,\" and you created a folder with the same name and path as described in Steps 1 and 2, type \"xcopy /e c:\work\files\. c:\backup\" and hit \"Enter.\" This command copies the complete folder structure, along with all files contained within, to the second folder.

Related Searches


  • Photo Credit BananaStock/BananaStock/Getty Images
Promoted By Zergnet


You May Also Like

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

Is DIY in your DNA? Become part of our maker community.
Submit Your Work!