The commands in Command Prompt are very useful and they can help you to solve many problems on computers. However, do you know some commands that can back up your files? In this guide on MiniTool Website , we will show you some backup commands in CMD. Scroll down to learn more details about them!

Can You Backup Files from Command Prompt?

File backup is very important for most computer users to prevent data loss because accidental errors may crop up at any time such as Windows update errors , system restore errors, file system errors , virus attacks, system crashes , hard disk failures and so on.

There are two inbuilt backup and recovery programs in Windows - File History and Backup and Restore . However, sometimes, you may find that Windows 10 backup stops working such as File History stops working, the backup does not complete successfully and more.

Fortunately, there are other backup tools in Windows – Windows 10 backup command line tools, which enable you to backup files from Command Prompt. What’s more, backing up files from Command Prompt allows you to backup data without booting into Windows and they are pretty useful when your system fails to boot. In this guide, we will introduce 4 types of Windows 10 backup command line tools – Xcopy, Robocopy, Notepad CMD, WBAdmin and show you how they work step by step.

4 Ways to Backup Files from Command Prompt

Way 1: Back up via Robocopy Command

When you want to copy, transfer or back up some files, the combination of Copy & Paste or Ctrl + C & Ctrl + V might meet your needs. However, if you need to execute complex or large file copy operations, the basic copy tools are not convenient because you have to wait for a pretty long time.

In this case, Robocopy (also called Robust File Copy) may satisfy you. This tool provides you with more than 80 command-line parameters and switches, so you can back up desired files quickly and efficiently. To back up large files with this Windows 10 backup command line tool, you need:

Move 1: Enable File Sharing

Step 1. Press Win + E altogether to open File Explorer .

Step 2. Locate the folder which contains the files that you want to back up and right-click on it to choose Properties .

Step 3. Under the Sharing tab, hit Share .

Tip: If you cannot find the Sharing tab, just go to File Explorer > View > Options > tick Use Sharing Wizard (Recommended) under the View tab > hit Apply .

hit View & Options

Step 4. Click on the inversed arrow to select Everyone in the drop-down menu and tap on Add .

choose Everyone

Step 5. Under Permission Level , either choose Read or Read/Write according to your need. The former option allows you to view and open the sharing folder and the latter one permits you to view, open, and modify the content of the file.

choose the permission level

Step 6. Click on Share > Done > Close and then wait for the completion message to pop up.

Move 2: Back up Large Files with Robocopy

Step 1. Press Win + R at the same time to open the Run dialog.

Step 2. Type cmd and hit Ctrl + Shift + Enter to launch an elevated Command Prompt .

Step 3. The basic Robocopy command syntax is: Robocopy [source] [destination] . For example, if you want to back up the contents of D:\FORMS to F:\backupdata , you can run this command: Robocopy “D:\FORMS” “F:\backupdata” .

back up file with Robocopy

Way 2: Back up via Xcopy Command

You can also back up your files or directories using the XCopy command on Windows PC. This command is more powerful than the Copy command and it has three significant features: identifying updated files, excluding files based on file names & extensions, and directly copying the directory. Here’s how to use this Windows 10 backup command line tool to back up a file:

Step 1. Run Command Prompt as an administrator.

Step 2. To back up the files you want, you need to follow this command syntax and run your command: XCOPY [source] [destination] [options] . For example, if you want to copy the News2023 file from the News folder of C drive to the Posts folder of E drive , run the command as follows:

XCOPY C:\News\News2023 “E:\Posts” /I

back up the News2023 file

The I/ parameter will force Xcopy to assume the destination is a directory. If you don’t use this parameter and you would like to copy from a source that is a directory or file group & copy to a non-existent destination, the Xcopy command will hint to you to enter whether the destination is a file or directory.


  • Like Robocopy, Xcopy doesn’t copy open files, either.
  • When the name of the file or folder is over 8 characters or contains spaces, you had better add quotation marks around the path to avoid any errors.
  • The filename is limited to 254 characters, or else the command will fail with the insufficient memory error.