Hi All
After seeing many posts asking for the best free tools to backup and restore a Windows image, I decided to create this guide showing how to use commands in WinPE (Windows Preinstallation Environment). Everyone with a Windows setup USB already has a WinPE boot disk. You can create a custom WinPE boot disk, but that's another topic.
So let's get started.
In my guide I'm using a Windows VM (virtual machine) with two disks (C: and E
and a mounted ISO (D
. The mounted ISO will be your Windows setup USB. C: and E: could be two partitions on the same disk, but most people would want backup the Windows partition is a separate internal or external disk.
1) Check and Identify OS and Backup Partitions
1.1 - Insert the Windows setup USB and restart the computer
1.2 - Boot to Windows setup
1.3 - At the first setup screen hold SHIFT+F10 to open a CMD window
1.4 - Start Diskpart
1.5 - "List Volume", to verify drive letters for each partition, these can change from the assigned letter in the Windows OS
For some reason my Windows partition doesn't have a drive letter. If you have the same issue, go to section 2 to assign a drive letter, else skip to section 3.
2) Assign a Drive Letter
2.1 - "List Disk" to show connected disks
2.2 - "Select Disk 0", disk 0 is usually the first disk with the OS
2.3 - "List Partition", to check the correct disk with the Windows OS is selected. A GPT formatted disk will include these four partitions. If you don't see the partitions as listed below go back a step and select another disk
2.4 - "Select Partition 3", to select the Windows partition
2.5 - "Assign Letter=W", to give the Windows partition letter W
2.6 - "List Volume", to confirm the Windows partition now has the driver letter W
2.7 - "Exit", to leave Diskpart
3) Capture the OS partition to an Image
3.1 - "Dir W:", to verify the source to capture
3.2 - "Dir C:", to verify the backup location, e.g. C:\OS_Capture
3.3 - Capture W: to "C:\OS_Capture\My_Windows_Backup.wim"
3.4 - Exit CMD and restart the computer
3.5 - The captured image
4) Update (Append) the Captured Image
4.1 - Let's make some changes and capture (append) to the existing image, or repeat the earlier steps to capture to a new image.
4.2 - Restart and boot using the Windows setup USB
4.3 - Start Diskpart and check drive letters. For my VM I need to reassign a letter to Windows.
4.4 - Repeat steps in Section 2
4.5 - Letter W assigned to the Windows partition
4.6 - Exit Diskpart
4.7 - Run the Append-Image command to add changes to an existing image, or replace with Capture-Image if you want to create new image file
4.8 - Check the images captured to the WIM
5) Restore an Image to the OS Partition
These steps restore an image to the existing OS disk with the partitions already create. If restoring to a new disk, follow the steps in section 6 to create the partitions then return to this section.
Before an image can applied the partition needs to be formatted
5.1 - Restart and boot using the Windows setup USB
5.2 - Start Diskpart and check drive letters. For my VM I need to reassign a letter to Windows.
5.3 - Repeat steps in Section 2
5.4 - Letter W assigned to the Windows partition
5.5 - Method 1 - Format using Diskpart
5.6 - Method 2 - Format using WinPE
5.7 - Apply (restore) image index 1 from the backup WIM to the Windows partition, e.g. to undo changes
After seeing many posts asking for the best free tools to backup and restore a Windows image, I decided to create this guide showing how to use commands in WinPE (Windows Preinstallation Environment). Everyone with a Windows setup USB already has a WinPE boot disk. You can create a custom WinPE boot disk, but that's another topic.
So let's get started.
In my guide I'm using a Windows VM (virtual machine) with two disks (C: and E



1) Check and Identify OS and Backup Partitions
1.1 - Insert the Windows setup USB and restart the computer
1.2 - Boot to Windows setup
1.3 - At the first setup screen hold SHIFT+F10 to open a CMD window

1.4 - Start Diskpart

1.5 - "List Volume", to verify drive letters for each partition, these can change from the assigned letter in the Windows OS

For some reason my Windows partition doesn't have a drive letter. If you have the same issue, go to section 2 to assign a drive letter, else skip to section 3.
2) Assign a Drive Letter
2.1 - "List Disk" to show connected disks

2.2 - "Select Disk 0", disk 0 is usually the first disk with the OS

2.3 - "List Partition", to check the correct disk with the Windows OS is selected. A GPT formatted disk will include these four partitions. If you don't see the partitions as listed below go back a step and select another disk

2.4 - "Select Partition 3", to select the Windows partition

2.5 - "Assign Letter=W", to give the Windows partition letter W

2.6 - "List Volume", to confirm the Windows partition now has the driver letter W

2.7 - "Exit", to leave Diskpart
3) Capture the OS partition to an Image
3.1 - "Dir W:", to verify the source to capture

3.2 - "Dir C:", to verify the backup location, e.g. C:\OS_Capture

3.3 - Capture W: to "C:\OS_Capture\My_Windows_Backup.wim"
Code:
DISM /Capture-Image /CaptureDir:W: /ImageFile:"C:\OS_Capture\My_Windows_Backup.wim" /name:"Windows 11 Pro 24H2 20250416.1510"

3.4 - Exit CMD and restart the computer
3.5 - The captured image

4) Update (Append) the Captured Image
4.1 - Let's make some changes and capture (append) to the existing image, or repeat the earlier steps to capture to a new image.

4.2 - Restart and boot using the Windows setup USB
4.3 - Start Diskpart and check drive letters. For my VM I need to reassign a letter to Windows.

4.4 - Repeat steps in Section 2
4.5 - Letter W assigned to the Windows partition

4.6 - Exit Diskpart
4.7 - Run the Append-Image command to add changes to an existing image, or replace with Capture-Image if you want to create new image file
Code:
DISM /Append-Image /CaptureDir:W: /ImageFile:"C:\OS_Capture\My_Windows_Backup.wim" /name:"Windows 11 Pro 24H2 20250416.1530"

4.8 - Check the images captured to the WIM
Code:
DSIM /Get-ImageInfo /ImageFile:"C:\OS_Capture\My_Windows_Backup.wim"

5) Restore an Image to the OS Partition
These steps restore an image to the existing OS disk with the partitions already create. If restoring to a new disk, follow the steps in section 6 to create the partitions then return to this section.
Before an image can applied the partition needs to be formatted
5.1 - Restart and boot using the Windows setup USB
5.2 - Start Diskpart and check drive letters. For my VM I need to reassign a letter to Windows.
5.3 - Repeat steps in Section 2
5.4 - Letter W assigned to the Windows partition
5.5 - Method 1 - Format using Diskpart
Code:
Diskpart
Select disk 0
List partition
Select partition 3
Format quick fs=ntfs label="Windows"

5.6 - Method 2 - Format using WinPE
Code:
Format W: /Q /V:Windows

5.7 - Apply (restore) image index 1 from the backup WIM to the Windows partition, e.g. to undo changes
Code:
DISM /Apply-Image /ImageFile:"C:\OS_Capture\My_Windows_Backup.wim" /Index:1 /ApplyDir:W:

Last edited: