By Ivy / Last update December 13, 2021

Quick Navigation:

How to backup hard drive from command prompt?

“My hard drive showing the low disk space error in my Windows 10 computer, I want to backup the entire hard drive to external one to spare more free space on the hard disk, How do I backup my hard drive from command prompt? Or other backup tools should I know? Please help, thanks in advance.”

Multiple ways to backup hard drive

Some users ask if there a way to backup hard drive with diskcopy cmd. However, diskcopy only copy the contents between floppy disks, and it’s not available in Windows 10. If you use diskcopy with a hard disk, you will get invalid drive specification error. Unfortunately, Microsoft Windows does not support the diskpart clone disk as you wish as well.

In Windows 10/8/7, there are some backup tools you may interested in:

  • Backup and Restore: create system image backup for Windows Vista, 7, 8, 10 and Server 2008 (R2), and backup data files in Library, Desktop, Windows folder, etc.

  • File History: only backs up files in the Documents, Music, Pictures, Videos, and Desktop folders and the offline OneDrive files in Windows 8, 8.1, 10.

There are two understandings of backup hard drive: clone hard drive with all the data included to another location, no compression; backup entire hard disk to an image file with high compression ratio. Hence, using the following command prompt backup hard drive easily:

  • Xcopy (file-level backup, for all Windows systems, DOS, etc).

  • Wbadmin (Windows Vista, 7, 8, 10, and Server 2008 (R2), Server 2012).

  • AMBackup.exe (Windows XP, Vista, 7, 8, 10).

Backup hard drive files via Xcopy command

According to Microsoft website, the syntax of Xcopy is:


[] [/w] [/p] [/c] [/v] [/q] [/f] [/l] [/g] [/d [:MM-DD-YYYY]] [/u] [/i] [/s [/e]] [/t] [/k] [/r] [/h] [{/a | /m}] [/n] [/o] [/x] [/exclude:FileName1[+[FileName2]][+[FileName3]] [{/y | /-y}] [/z] [/b] [/j]

To copy all files and directories(including hidden or system files) from drive D to drive E, input the command:

xcopy d: e: /s /e /h

  • /s: Copy directories and subdirectories, unless they are empty.

  • /e: Copy all subdirectories, even if they are empty. 

  • /h: Copy hidden or system files.

Xcopy Backup Hard Drive

Besides, you could use the parameter:

  • /r: overwrite read-only files in destination if need be.

  • /d [:MM-DD-YYYY]: Copy source files changed on or after the specified date only. If not specify a MM-DD-YYYY value, and it copies all Source files to the destination.

  • /c: Ignore errors.

  • /y: Suppress prompting to confirm that you want to overwrite an existing destination file.

If the source and destination disk own the different format, use Xcopy command line instead of diskcopy (only support the same format disks).

WBadmin command prompt backup hard drive

It’s easy for you to create a full backup that includes all the drives connected to your PC via Wbadmin command. Follow the steps below to backup hard drive from Wbadmin command prompt:

1. Open an elevated command prompt: You can type CMD in the search box, and in the listed results, right-click Command Prompt and choose Run as administrator.

2. Then run the following command: (backup disk to an image file).

wbadmin start backup -backupTarget:F: -include:C:, D:,E: -allCritical -quiet

Wbadmin Start Backup

This command will create a backup including your C, D, and E drive to F drive. When you write command to backup your hard drive, you need to change the drive letters based on your situation.

  • The switch: -quiet means to run the backup without prompting for extra input. Therefore, the backup will start right away after input this command.

  • If one of the partition that needs backing up does not have a drive letter, you can include this partition using volume GUID, which can be revealed by running “mountvol” command.

For example:

wbadmin start backup -backuptarget:\\\Public\backup -allCritical -include:C:,D:,E:,\\?\Volume{95b895b8-0000-0000-0036-223470000000}\

Wbadmin Backup

As you can see from the screen, WBadmin also allows you to backup to a network shared folder. If the shared folder is encrypted, you will need to use switch -user:username and -password:userPassword to input your user name and password. If you need to let WBadmin restore backup from command line, run wbadmin start recovery command prompt.

Backup hard drive with AMbackup.exe command

You could use the third-party disk backup software - AOMEI Backupper Professional, which provides you the command prompt named AMbackup.exe to create hard drive backup easily with a simpler command. It provides specified command to backup hard drive, partition, and system. It provides multiple editions for both Windows PC and Server.

To backup hard drive from command prompt to an image file using AMbackup.exe, please download AOMEI Backupper 30 day free trial first and have it a go:

Download Free Trial Win 11/10/8.1/8/7/XP
Secure Download

1. Execute the comprehensive disk backup software - AOMEI Backupper Professional.

2. Open an elevated command prompt and type the path of the installation directory of AOMEI Backupper and press Enter.

For example: cd C:\Program Files (x86) \AOMEI Backupper


Tip: After installing, right-click the AOMEI Backupper icon on the desktop, select Open file location to get the installation directory.

3. Write a command referring to the following to backup an entire hard disk:

AMBackup.exe /b new /t disk /s [source disk number] /d “[target location path]” /n “[task name]”

For example, the disk backup command prompt line is:

AMBackup.exe /b new /t disk /s 0 /d “E:\disk backup” /n “Disk Backup”

This command will create a new backup task named “Disk Backup” include the whole disk 0 to E:\disk backup folder.

  • /b: specify the type of backup, it could be new, inc(incremental backup), dif(differential backup) or full.

  • /t: specify the type of source, it could be system, disk, or part.

  • /s: specify the source for the backup.

  • /d: specify the destination path for the backup.

  • /n: assign a name for the backup.

Backup Hard Disk Command Prompt AMBackup

Once you run the backup task, and AOMEI Scheduler will open immediately at the lower right corner of the desktop, and the disk backup task will run backgrounds. See more details, please open AOMEI Backupper GUI to check.

AOMEI Scheduler Running

Besides, you could use clone hard drive command prompt to clone the entire disk easily, just input the command: (copy all data, no compression).
AMBackup /c /t Disk /s 0 /d 1 /a

This command will clone disk 0 to disk 1 and using partition alignment to optimize for SSD.

  • /c: specify a clone task.

  • /a: specify to use partition alignment to optimize for SSD.

Clone Hard Drive Command Prompt

Input yes after executing the cloning to delete all data on the destination disk, or input no to backup critical data first, then run the above command line prompt.

Easier way: Backup hard drive with GUI version of AMBackup.exe

If the command line prompt still complex for you, you could run the AMBackup.exe GUI - AOMEI Backupper, which offers you a user-friendly interface and easy to operate features, like a disk, system, or partition backup, clone, restore, and sync functions.

1. Open AOMEI Backupper GUI, select Backup -> Disk Backup.

Disk Backup

2. Choose the hard drive you would like to backup as source disk, hit Next.

3. Tap another hard drive as a destination path to save data from source disk, hit Next.

4. Press Start Backup to backup hard drive without command prompt in Windows 7/8/10/11.

Sometimes, you may meet the unbootable issues when Windows computer fails to boot, and intend to backup hard drive without Windows, fix it easily.

In the End

It’s easy to backup hard drive from command prompt or the professional disk backup software - AOMEI Backupper. Find the suitable way to backup data safely and easily.

Besides, AOMEI Backupper has the ability to create bootable media to boot up your computer when Windows 11/10/8/7 failed to boot, then backup data; allow you to restore to dissimilar hardware computer if needed; create incremental or differential backup, schedule backup, real-time file sync, etc.

For who are running Windows Server 2003/2008/2012/2016/2019(including R2), please try AOMEI Backupper Server to enjoy more advanced features.