Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Windows 11 / Create a Custom Windows Image with Pre-installed Apps (WIM/ISO)

May 25, 2026

Create a Custom Windows Image with Pre-installed Apps (WIM/ISO)

In this guide, we’ll cover how to create a custom Windows 10/11 installation image with pre-installed apps, necessary files, and other environment and application settings. Currently, many admins prefer deploying a clean Windows image and then installing all required applications and tools afterward. This can be done using software deployment via GPO, using the installation commands defined in AutoUnattend.xml or with the %WINDIR%\Setup\Scripts\SetupComplete.cmd script (allow to install software during OOBE), as well as GPO logon scripts. or using other automation tools (SCCM, Intune, MDT, Ansible).

However, in some cases, business specifics require that a fully pre-configured Windows image containing all the necessary programs be deployed to end-user computers. Such an image can be rapidly deployed across multiple machines within an organization without the need for manual software installation or basic system configuration. This article has been updated to reflect the latest Windows 11 25H2 build.

Contents:
  • Build a Reference Windows Image with Pre-installed Software
  • Capture a Custom Windows Image Using DISM
  • Replace the Original Install.wim File in the Windows Installation Image

The process of creating your custom Windows installation image with pre-installed software can include the following steps:

  1. Deploy a clean Windows instance on a reference computer (virtual machine).
  2. Boot Windows in Audit Mode, then install the apps and configure the environment.
  3. Boot the device into the WinPE environment and use the DISM command to capture the WIM image of the installed Windows.
  4. Replace the original install.wim file on the installation USB stick (ISO image).
If you are deploying Windows to computers on a corporate network, it is more convenient to use MDT, which allows you to add/update programs during the installation process without having to modify the installation WIM image each time.

Build a Reference Windows Image with Pre-installed Software

The first step is to create a reference image of Windows with all the programs, files, and settings you need. Perform a clean Windows installation on either a virtual machine or a physical computer.

Download the original Windows 11 installation image as an ISO file, or use the Media Creation Tool or Rufus to burn it directly to a bootable USB flash drive.

Perform a manual Windows installation and press CTRL+SHIFT+F3 at the OOBE stage (when prompted to select regional settings and create an account). This will put the computer into Audit Mode, and you will be automatically logged in using the built-in Administrator account

boot Windows 11 into Audit Mode

When the desktop appears, minimize the Sysprep window (don’t close it!!). Then you can start installing programs and updates, and configuring the necessary Windows settings.

Download and install all the latest updates for your version of Windows (either automatically via Settings > Windows Update, manually, or using the PowerShell update management module).

Install the latest Windows updates

Install all the necessary software, such as Microsoft Office, and install any device drivers, tools, services, and apps that your users need.

I will use the built-in WinGet package manager to install various apps and tools on Windows. Please note that apps should be installed for all users of the computer (--scope machine), not just the current user (otherwise, this will cause additional problems when preparing the image via Sysprep, as discussed below).

winget install -e --scope machine 7zip.7zip Git.Git Microsoft.VisualStudioCode Microsoft.Sysinternals Notepad++.Notepad++ VideoLAN.VLC WinDirStat.WinDirStat dotPDN.PaintDotNet IrfanSkiljan.IrfanView

Installing software on Windows using the Winget tool

I also manually created directories and copied files for several business apps

Customize reference Windows image

Create the desktop shortcuts, customize the Start menu and Taskbar layout, pin items to the taskbar, customize wallpapers, screensavers, color schemes, and more.  Configure local Group Policy settings using the gpedit.msc editor. These settings will be applied to all computers that you deploy from this custom Windows image.

Check if the BitLocker encryption is disabled for the system drive (in Windows 11, BitLocker drive encryption is automatically enabled on all supported devices):

manage-bde -status

Disable the BitLocker encryption:

manage-bde -off C:

Manage-bde command: disable the BitLocker drive encryption

Once you have finished configuring the operating system and applications, you need to prepare the system for deployment, clean up, and optimize Windows to minimize the final image size.

Delete the C:\Windows.old folder (otherwise, a Windows installation error will appear when deploying from such a WIM image.):

rmdir c:\windows.old -Force -Recurse

Delete existing shadow copies and system restore points:

vssadmin delete shadows /All /Quiet

Clean up unused components and update files in the WinSxS folder:

Dism.exe /Online /Cleanup-Image /StartComponentCleanup /ResetBase

Delete the Windows Update cache files:

del %windir%\SoftwareDistribution\Download\*.* /f /s /q

This PowerShell script can be used to clean up the Temp, Downloads, and Cache folders in the user profile.

Perform a disk cleanup using the cleanmgr tool:

Cleanmgr /sagerun:1

Clear the Event Viewer logs:

for /F "tokens=*" %1 in ('wevtutil.exe el') DO wevtutil.exe cl "%1"

Empty the Recycle Bin in Windows:

Clear-RecycleBin -Force

To apply the current user’s settings to the Default user (used as a template when creating new Windows users), create an unattend.xml answer file in the C:\Windows\System32\Sysprep directory.

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CopyProfile>true</CopyProfile>
</component>
</settings>
</unattend>

Copy unattend.xml to sysprep directory

The final step is to use the sysprep.exe tool to prepare your custom Windows 11 image for deployment. Expand the Sysprep window and select the following options:

  • Enter System Out-of-Box Experience (OOBE)
  • Generalize
  • Shutdown

Sysprep: prepare image for deployment

Using Sysprep with the Generalize option prepares the image for deployment and resets the local machine security identifier (SID), ensuring that no computers in your environment have duplicate SIDs.

You may receive the following error after running the Sysprep command:

Sysprep was not able to validate your Windows installation. Review the log file at %WINDIR%\System32\Sysprep\Panther\setupact.log for details. After resolving the issue, use Sysprep to validate your installation again.

Sysprep error: cantvalidate your Windows installation

Open and analyse the Sysprep log file (setupact.log) in the %WINDIR%\System32\Sysprep\Panther directory for the most recent errors.

In my case, the last error in the setupact.log file indicates that the Notepad++ Microsoft Store app is installed only for the current user and has not been provisioned for all users in the Windows image:

Error  SYSPRP Package NotepadPlusPlus_1.0.0.0_neutral__7njy0v32s6xk6  was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image.
Error  SYSPRP Failed to remove apps for the current user: 0x80073cf2.

sysprep error: failed to remove store app for current user

As mentioned earlier in the WinGet installation example, this problem can be prevented by installing applications system-wide for all users.

To successfully prepare the image with SysPrep, you need to:

  • Uninstall this Microsoft Store app: Get-AppxPackage -AllUsers | where-object {$_.PackageFullName -like '*NotepadPlus*'}| Remove-AppPackage –AllUsers -verbose
  • Or, you can install the app into the system account using the Add-AppxProvisionedPackage command, which will automatically install the app for all new users.

Run the Sysprep again. If the error persists, repeat these steps for each Microsoft Store app that appears in the error log.

Remove-AppPackage

When this process is complete, the computer will automatically shut down.

Capture a Custom Windows Image Using DISM

At this stage, you will need to capture an offline Windows image from a local drive, save it as a WIM file, and place it on a separate drive (we connected an empty 60 GB drive to the computer).

Rather than using local storage, you can initialize the network in WinPE and capture the WIM image to a mounted network share.

Boot the computer with the referenced Windows image into the WinPE or WinRE environment. If you are using a Windows installation USB stick, boot the computer from it and press Shift+F10 to open the command prompt.

Identify the drive letters assigned to the Windows partition and the empty drive to which the WIM file will be copied. Run the commands:

diskpart
list disk
exit

check drive letter assigned

In this example, the drive containing Windows is assigned the letter E: and the empty drive is D:.

To capture an offline Windows image drive E:\ and save the resulting WIM image to the drive D:\, run the command:

dism /capture-image /imagefile:D:\install.wim /capturedir:E:\ /ScratchDir:D:\ /name:"MyWinImage" /compress:maximum /checkintegrity /verify /bootable

It took about 30 minutes to capture the image in my case.
Capture Windows image with DISM

Replace the Original Install.wim File in the Windows Installation Image

Once you have captured your customized Windows image, you can replace the original install.wim or install.esd image file in the\sources folder on the installation USB flash drive or ISO image file (ESD is the compression format with the highest compression ratio used for WIM files).

If you need to edit the installation ISO image file, you can use the free AnyBurn tool.

In my case, I renamed the old image file to install.esd_bak and copied the new install.wim image to the USB stick.

replace the original install.wim file with a custom wim image

Note that the WIM image size with pre-installed software has increased significantly, from 7GB to 10GB.

If you use a FAT32 bootable USB key to install Windows on UEFI computers, you cannot save a WIM file larger than 4GB to this file system. A large WIM image file must be split into several smaller SWM files:

Dism /Split-Image /ImageFile:D:\sources\install.wim /SWMFile:c:\tmp\install.swm /FileSize:3500

In this case, DISM will create the following files install.swm, install2.swm, install3.swm, and so on. Copy these files to the \sources folder on the installation media or ISO image. When Windows Setup installs the operating system, it merges the SWM files.

Now you can use your bootable USB flash drive to deploy the Windows image you created to any computer (you can also install Windows over the network using PXE boot).

 In some cases, the following error may appear when deploying a preconfigured Windows image:

Windows 11 Installation has failed

Windows 11 custom image Installation has failed

In my example, the installation failed at 78%.

To view a detailed explanation of the error, open the command prompt by pressing Shift+F10 and enter the following command:

notepad C:\$Windows.~BT\Sources\Panther\setuperr.log

This will open a text log of errors relating to a clean Windows 11 installation. Scroll to the end of the log and review the most recent errors. In my case, it was clearly stated that the installation error was caused by Windows.Old folder which located in the root directory of the system drive (I forgot to delete this folder when preparing my reference image). You can install Windows after deleting the folder from the system image. It is possible to mount and modify a WIM installation image without having to recapture it from scratch using the DISM /mount-wim command (see an example here).

Check Windows install error in setuperr.log

Check that all preinstalled apps are available after Windows installation is complete:

Get-Package

Deploy custom Windows image with preinstalled software

The downside of this method of deploying a preconfigured Windows image is that you have to rebuild the image to update any of the apps it contains.

Windows updates and drivers can be integrated directly into the WIM image. In this case, there is no need to go through the full deployment and image capture cycle.
10 comments
19
Facebook Twitter Google + Pinterest
Windows 10Windows 11
previous post
Find a Linux Process Listening on a Specific Port
next post
Adding ESXi Host to VMware vCenter Server (vCSA)

Related Reading

How to Allow Multiple RDP Sessions on Windows...

April 28, 2026

How to Run Program without Admin Privileges and...

June 8, 2023

How to Install RSAT (Remote Server Administration Tools)...

March 24, 2026

Managing Windows Firewall Rules with PowerShell

March 11, 2024

Upgrading to Windows 11 on Unsupported Hardware

February 19, 2026

How to Fix ‘An Operating System Wasn’t Found’...

August 24, 2023

How to Allow Non-Admin User to Start/Stop Service...

March 15, 2024

Fixing ‘The Network Path Was Not Found’ 0x80070035...

August 31, 2023

10 comments

AllonZ February 29, 2024 - 10:58 pm

Thanks for the awesome tutorial!

It has given me great insight on how to prep my custom ISO since I have not had great success with other methods.

I do have a few questions that I hope don’t mind answering. It could save me much time and aggravation.

I do not have a “reference computer” or any experience with virtual machines. Can Hyper-V Manager accomplish the task in the article?

If not, is there a free virtual machine service, like Oracle VM VirtualBox or VMware Workstation Player, that can do this and use the hardware drivers from the host machine?

Thanks again!

Reply
Kiril July 10, 2024 - 11:31 am

Thank you for tutorial!
I did everything from it.
Tried to install the image, get to the point I need to enter license key and after entering right key (from the label on the bottom of the laptop) I get an error message saying: “The product key entered does not match any of the windows images available for installation. Enter a different product key”
I’m using Win11 Pro OEM version
Tried to create PID.txt file with: [PID] Value=xxxxx-xxxxx-xxxxx-xxxxx-xxxxx, with license key itself – doesn’t work.
Tried to create ei.cfg file and write in it: [Channel] Retail
[VL] 0
doesn’t work.

Would appreciate help

Reply
TAS October 19, 2025 - 12:47 pm

i have the same issue if you had already solved it, please tell me the solution
thanks in advance

Reply
Francesco September 2, 2024 - 10:20 am

Is it mandatory to customize the image in audit mode? In other words, what isntead if I setup everything when the physical pc boots up the first time and then once finished I run the sysprep /oobe /generalize /shutdown ? Thanks.

Reply
admin September 3, 2024 - 12:32 pm

In the audit mode, the default user profile settings are updated. These settings are then applied to all new users. Also, this allows to remove user-specific information from the user profile.
If audit mode is not used, the user setting in the profile will be lost during OS deployment.

Reply
AtariBaby September 10, 2024 - 7:54 pm

Advice here:
*The best disk part command is “list volume”. For me anyway list disk does not show drive letters.
*I had to remove “client web experience” and “widgets platform runtime” to finish sysprep. Also had to remove notepad++ that I had installed from winget.
*i found one of the commands didn’t work: “ del %windir%\SoftwareDistribution\Download\*.* /f /s /q” i had to find an updated command for this but now i can’t remember what it was sorry!

Reply
Vincent Oliver October 16, 2025 - 4:24 am

Hi Woshub Team,

I used this tutorial twice,
In Windows 11 22H2, this method worked very well, but now in Windows 11 24H2 & 25H2 it states an error “Windows 11 Installation Failed” during Installation even everything is fine and if I use that captured ‘Install.wim’ in Windows 11 23H2’s ISO it just work fine without any issue.
Please help me out getting it fixed.

Thanks
Vincent Oliver

Reply
admin October 16, 2025 - 2:12 pm

Hi Vincent,
Start troubleshooting your case by checking the Windows deployment logs on the device. This guide explains the relationship between common Windows deployment scenarios and phases and different log files.
https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/deployment-troubleshooting-and-log-files?view=windows-11

Reply
Alfred October 22, 2025 - 3:03 pm

Remove C:\Windows.old before running sysprep

Reply
Ken October 23, 2025 - 5:47 am

Windows 11 installation failed after selecting the installation drive, can the administrator guide me to fix it specifically, I’m a newbie

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • How to Monitor Windows Machines with Zabbix

    May 26, 2026
  • Fixing Duplicate Security Identifier (SID) Issues in Windows

    May 25, 2026
  • Monitor a Folder for File Changes Using PowerShell and FileSystemWatcher

    May 15, 2026
  • Protect Windows Server from DDoS and Brute-Force Attacks with IPBan

    May 12, 2026
  • How to Force Uninstall ANY Stubborn Program in Windows

    May 7, 2026
  • How to Safely Disable IPv6 on Windows

    April 30, 2026
  • Updating UEFI Secure Boot Certificates on Windows Devices Explained

    April 20, 2026
  • Security Warnings When Opening RDP Files in Windows 11

    April 17, 2026
  • Find Computers with Pending Reboot Status Using PowerShell

    April 15, 2026
  • Mounting NFS Shares in Windows Using the Built-in Client

    March 26, 2026

Follow us

  • Facebook
  • Twitter
  • Youtube
  • Telegram
Popular Posts
  • How to Allow Multiple RDP Sessions on Windows 11 and 10
  • How to Run Program without Admin Privileges and Bypass UAC Prompt
  • Fix: BSOD Error 0x0000007B (INACCESSABLE_BOOT_DEVICE) on Windows
  • Fixing ‘The Network Path Was Not Found’ 0x80070035 Error Code on Windows
  • How to Delete Old User Profiles in Windows
  • How to Install RSAT (Remote Server Administration Tools) on Windows
  • How to Backup and Copy Local Group Policy Settings to Another Computer
Footer Logo

@2014 - 2026 - Windows OS Hub. All about operating systems for sysadmins


Back To Top