How to Backup Files from Command Prompt

At times, we come across Windows boot issues that prevent us from booting into Windows 10/8/7. Sure, one can use Windows recovery tools to fix most of startup related issues but there are some errors that can’t be fixed through recovery environment. This is a time that you want to recover data on your computer. However, for most home users, the importance of backing up data is ignored until it is too late. It becomes obvious that they should have backed up their data and settings after the computer stalls. You will no longer have the ability to log in to windows when your operating system malfunctions. This could be caused by a virus that continuously shuts the PC down, corrupt, missing or infected windows files. If you have such a problem, you have come to the right page. We are going to show you how you can gain access to data on your computer and back up your data before reinstalling windows.

Of course the hard drive can always be put into another computer as a 2nd drive or into an External USB case. Either would allow you to copy the data to removable media such as CD, DVD, or other USB drives. If you are working from a heavily encased laptop or you can’t find a computer that can accommodate a second drive, recovery the data becomes tricky. You can reinstall Windows, but if you have run out of space, this will not be possible. There are several back up software that you can use to recover your data. If you don’t want to spend a penny on something you could easily do, then the best bet is using command prompt to back up your data if you have to format your partition to reinstall windows.

Windows has always distributed its operating system with the old MSDOS command line interface. You can always choose to boot into this operating system during startup or during recovery. To boot into command prompt and back up your data, follow the methods bellow. You will require a removable drive e.g. a pen drive or flash disk or external hard drive to back up your data into.

Method 1: Use command prompt and Notepad to back up your data to the external storage

Backing up data is a matter of copying it to a different location. We will boot the computer into the command prompt system, identify our files and back them up. For those that are not familiar with the commands that command prompt offers, you can use notepad to launch a graphical user interface that you are used to.

  1. Turn on your PC, press F8 key during the startup and then select Repair Your Computer option under Advanced Boot Options to boot into the recovery environment. If you can’t see Repair Your Computer option under Advanced Boot Options you will need to use the installation media e.g. your retail Windows DVD.
  2. If you are using a bootable DVD or USB drive press any key when are asked to do so. When you press a key, Windows starts loading files from the DVD you will see “Windows is loading files” message. Select your language, keyboard type, language, and then click Next button.
  3. In the following screen, you will see Install now button. Don’t click on the ‘Install now’ button as doing so will take you to the installation screen. Click Repair your computer option located in the lower left corner to start System Recovery Options. System Recovery Options will search for Windows installations and list them. Select the operating system, click Next button to see available recovery tools.
  4. In this screen, you will all available System Recovery Options.
  5. Click on Command Prompt.
  6. In the Command Prompt, type Notepad.exe and press Enter key to launch the Notepad application. Once the application is launched, click on File > Save As (you use Ctrl + S keys as well) to launch Save As dialog.
  7. Locate the files you want to back up
  8. Plug in your USB or external storage
  9. Right click on the files and/or folders you want to back up and select ‘send to’ your USB drive.

This demonstration is performed on Windows 10. Your PC might freeze up for a while during the copying, so do not terminate the action prematurely. You can reinstall your Windows OS after you have copied all the data you want.

Method 2: Use command prompt commands to back up your data to the external storage

Here we will use command prompt lines/commands to identify our files and the backup location and copy those files into the backup location.

  1. Follow steps 1 – 5 in method 1 to launch command prompt
  2. To see your drive available type ‘diskpart’ and hit enter. Now type ‘list volumes’ and hit enter to see all available drives and their letters. Now insert your USB drive and type ‘list volumes’ again and hit enter. The new drive letters in this list are the drive letters of your USB drive. They will also bare the name of the volume.
  3. Type exit and hit enter to exit the diskpart mode
  4. Type the letter of the drive that contains the data you want to back up e.g. C: and hit enter (There is no need to back up drives that you are not going to install windows into)
  5. Type dir to see all the folders and files in the drive C:
  6. To move into a folder type ‘cd foldername’ and hit enter. To step back to the previous folder, type ‘cd..’ and hit enter.
  7. To copy a certain folder or a file to your drive type xcopy DirectoryPathToCopy DriveLetterToCopyInto\ /E
  8. For example xcopy C:\Users E\ /E will copy users files and folders to drive E:.
  9. The last letter \E tells the command to copy folders and subfolders including empty ones. To get more help type ‘help xcopy’
  10. You can now go ahead and reinstall your Windows operating system

If you need any help on installing an operating system, you can get our guide on clean installing Windows 10 here.


Kevin Arrows

Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.