Setting up Windows 11 with all the necessary applications and files can often feel like a daunting task. The process of backing up files and programs to ensure a smooth transition to a new PC is not straightforward. However, with some careful preparation, it is possible to create a complete Windows image in a WIM file format, allowing for a seamless restoration on a new machine.
What you’ll need
You have to do it on a fresh install
To begin, if you intend to back up your Windows image using the Deployment Image Servicing and Management (DISM) tool, it is crucial to prepare your system accordingly. This starts with generalizing your current installation using the System Preparation tool, known as Sysprep. Generalizing an image ensures that Windows is captured without any user-specific data or installed drivers, although the driver files themselves will be included.
However, it’s important to note that generalizing a Windows image comes with specific prerequisites. Any applications installed or updated via the Microsoft Store must be avoided prior to this step, as they are tied to the current user and will cause Sysprep to fail. Therefore, this process must be undertaken on a fresh installation of Windows 11, ideally before you even reach the desktop. Having a second computer on hand for adjustments can be beneficial, but it is possible to manage with just one machine if approached carefully.
Additionally, you will need two external drives: one to store the Windows image, which should be at least 8GB in size (though more may be necessary depending on your needs), and another to boot from for capturing and applying the image. The bootable drive must be configured with the Windows Preinstallation Environment (Windows PE), which presents its own set of challenges.
Creating a bootable Windows PE drive
A necessary tool
To capture and apply your Windows image, a bootable USB drive running Windows PE is essential. This advanced IT tool facilitates the deployment of Windows images but requires a bit of setup. Start by downloading both the Windows Assessment and Deployment Kit (ADK) and the Windows PE add-on for the ADK. Following the default installation process for both should suffice.
Microsoft provides official guidelines on utilizing the Windows ADK to create a Windows PE bootable drive, which can be found on their website. It is advisable to read these instructions carefully, as there are a few nuances to consider. For instance, after updating the Windows PE add-on, you may encounter issues with the copype command due to folder creation conflicts. Deleting the specified folder and re-running the command can resolve this. You can skip the customization section of the Windows PE image, as it is unnecessary for this process.
When creating bootable media, ensure you specify the correct drive. If your drive utilizes a GPT partition scheme, you may need to convert it to MBR to avoid errors during this step.
Generalizing your Windows image
Add what you need
To generalize your Windows image, enter Audit Mode as soon as you reach the out-of-box experience (OOBE) screen. Press Ctrl+Shift+F3 to access Audit Mode and begin preparing your Windows image. It is critical to remain offline during this phase to prevent any automatic updates or installations from the Microsoft Store.
Once in Audit Mode, disable app updates from the Microsoft Store and pause updates in Windows Update. This will ensure that no Microsoft Store apps are inadvertently installed while you prepare your image. You can then proceed to install any applications you wish to include in your Windows image, being mindful to select options that allow installation for the entire system rather than just the user account. For files you wish to keep, consider creating a dedicated folder on the root of the C: drive.
After setting up your desired applications, return to the Sysprep window. If it has been closed, you can reopen it by pressing Windows+R and entering the command:
%WINDIR%system32sysprepsysprep.exe
In the Sysprep interface, select Enter Out of box experience (OOBE), check the Generalize box, and choose Shutdown from the dropdown menu before confirming your selection.
Capturing the Windows image
A lot of care is required
With the system prepared, you will need both the Windows PE flash drive and the drive designated for storing the Windows image. It is advisable to use separate physical drives for clarity, although partitions may suffice if your drive is large enough. Connect both drives before powering on the computer and access the boot options or BIOS to ensure the system boots from the Windows PE drive.
Upon booting into Windows PE, you will be greeted with a Command Prompt window. Begin by using the
diskpart
command, followed by
list volume
to identify the drive letters assigned to your Windows partition and the storage drive. Assign letters to each drive as necessary, and then exit diskpart. The command to capture the image will look something like this:
Dism /Capture-Image /ImageFile:”D:ImagesWindowsImage.wim” /CaptureDir:C: /Name:WindowsImage
Wait for the process to complete before shutting down the computer.
Applying the image
Almost there
With the Windows image now ready, the next step is to apply it to the new PC. You will need to create a couple of additional files on the drive containing the Windows image. First, prepare a script for diskpart that will establish the necessary Windows partitions, which can be saved as a TXT file. For UEFI PCs, you can use a specific script, while a different one is required for classic BIOS systems.
Additionally, create a batch script (with a .BAT extension) for applying the image. Use the simplified script provided by Microsoft, ensuring to adjust the recovery partition size if necessary. Once both scripts are prepared, connect the Windows PE drive and the drive containing the Windows image and scripts to the target PC, and boot it up.
As before, ensure the system is set to boot from the Windows PE drive. Once the Command Prompt appears, use the diskpart and list volume commands to identify the drive letter for the Windows image and scripts. If needed, assign a letter, then execute the diskpart script to create the necessary partitions. Finally, apply the image using the batch script, and wait for the process to finish before shutting down the computer and removing the USB drives. Your new PC should now boot into Windows with the applied image.
Quickly set up a new PC
This method is particularly effective for those who frequently deploy a consistent set of applications across multiple PCs. It streamlines the installation of Windows and essential applications, maintaining a generalized experience that can be utilized on various devices. While the process requires considerable effort, the payoff is significant for regular users.