**Disclosure: This post contains affiliate links. If you make a purchase through these links, we may earn a small commission at no extra cost to you.
When it comes to installing an operating system on your computer such as Windows 11, you usually need to either buy a copy of Windows on a flash drive, create your own flash drive using the Windows Media Creation tool or download an ISO file and create your own flash drive using a tool such as Rufus or Ventoy.
If you are ok with installing Windows using all the default settings and options, that is fine. But if you want to customize the way Windows is installed and configured, there is a way to do that as well. In this article, we will be showing you how to create a custom auto unattended file and inject it into a custom Windows ISO file.
Creating your Custom Auto Unattended File
To create our custom auto unattended file, we will be using an online form that can be created from the website here.
There are many configuration options to choose from such as disk configuration, computer name, adding user accounts, removing Microsoft apps, personalization settings, bypassing Windows 11 requirements, taskbar configuration, system tweaks, visual effects, Wi-Fi setup and more.
We will install Windows 11 Pro, add a local user named Bob with a display name of Bobby, have the start menu on the left of the screen, have the background color be orange, remove some Microsoft bloatware apps and more.
Once you configure your settings, click the button that says Download .xml file. Then save your autounattend.xml file on your PC because you will need it for the next step.
Creating your Custom Windows ISO File with your autounattend.xml File
Now that we have our autounattend.xml file created, we will now use it to create our custom Windows ISO image file with all the custom settings it contains.
The first thing you will need to do is change the script execution policy to allow all scripts to run without any restrictions. When you set the policy to unrestricted, it enables the execution of any PowerShell script, regardless of its origin or whether it is signed. To do so, we need to open PowerShell as an administrator and run the following command.
Set-ExecutionPolicy Unrestricted
They type in A for Yes to All. You may be able to get away with just Y if you want to try that first.
Now we will need to run another PowerShell script as an administrator to launch the WIMUtil ISO builder tool. You can find information about this tool here.
irm “https://github.com/memstechtips/WIMUtil/raw/main/src/WIMUtil.ps1” | iex
This will open the WIMUtil tool, and we can now start to create our custom ISO file. You will need to select your ISO file by browsing for it on your computer. You can also download one using the WIMUtil tool itself. The Select Directory button is used to choose a temporary location where WIMUtil will keep its working files. You can choose any folder on your computer for this step.
The next step is where we will add our newly created answer file that we made in the previous step. The Download UW button can be used to load a preconfigured autounattend.xml file but we will be loading our own file for this step by clicking on the Select File button and browsing to the location of our autounattend.xml file.
The Add Drivers step is where you can extract hardware drivers from the computer that you are running the WINUtil tool on to use for your ISO file. This comes in handy if you plan on reinstalling Windows on the same computer you created the custom ISO file on.
The final step involves downloading oscdimg to be installed. Oscdimg is a command line tool used to create ISO image files. It’s part of the Windows Assessment and Deployment Kit (ADK). Then you can select a location for the ISO file to be placed at after it has been created.
Once you click the Create ISO button, you will then see the progress in the PowerShell window. This step should only take a couple of minutes to complete.
Installing Windows with the Custom ISO File
Now that our custom autounattend ISO file has been created, we can now use it to install Windows. Once you make a bootable flash drive, you can boot your computer with it which will start the installation procedure.
If you have ever installed Windows before using a retail ISO file, you will notice that the process will be different. It will also vary depending on how many things that you customized for your autounattend.xml file.
For our custom ISO, the first thing it does after we press any key to boot from the image is run some commands in the background.
Since we chose which version of Windows and preconfigured our hard drive settings in the first step, the installation goes right to the We’re getting a few things ready screen.
Then it starts installing Windows without any input from the user.
Once the initial installation is complete, Windows will then check for updates like it does when installing Windows the regular way.
Then it goes right into the first time user profile configuration screen like you would normally see when logging in with a new user account. Since we configured a user account and password in our autounattend.xml file, it logs it in for us.
Now we have our custom orange desktop with the start button and menu over to the left just like we configured.
We can then see the computer name we assigned in the first step and also see the local admin account that was created and logged in automatically.
On the GitHub page where you can find information about this process, there is also another script called UWScript that you can download and run on your new computer as well as other computers that already have Windows installed on them. You can use this tool to debloat and tweak your Windows settings for additional customization.
For additional training resources, check out our online IT training courses.
Check out our extensive IT book series.