on
PowerShell
- Get link
- X
- Other Apps
Setting up a fresh Windows installation? Installing multiple programs one by one can be tedious and time-consuming. ๐ฉ But there’s a smarter way to automate everything during the setup itself—by leveraging the power of autounattend.xml!
Let’s dive in and see how to automate the installation of multiple programs during Windows deployment. ๐ ️
autounattend.xml is a configuration file used by Windows Setup for unattended installations. It holds the answers to every prompt you’d normally click through manually, including:
✅ Disk configuration
✅ Language and region
✅ Product key
✅ User accounts
✅ … and yes, running commands to install extra programs!
This makes it a powerful tool for automated deployments in business, IT labs, or for personal use. ๐ข
Here’s why automating installations with autounattend.xml is a game-changer:
๐ Time-Saving – No need to sit and click “Next” repeatedly!
๐ Consistency – Every machine is set up exactly the same way.
๐ Error-Free – No missed steps or misconfigured apps.
๐ Silent Installs – Programs can be installed quietly in the background.
It’s perfect if you’re creating a golden image or want to roll out PCs in bulk. ๐
The autounattend.xml file uses XML syntax and is broken into configuration passes:
๐น windowsPE – Pre-installation tasks
๐น offlineServicing – Apply updates or drivers offline
๐น generalize – Sysprep phase
๐น specialize – Hardware-specific tasks
๐น oobeSystem – Final customization during first boot
The magic happens mostly in the oobeSystem or specialize passes. Let’s see how to add program installations! ⚡️
To install programs during setup, we use the FirstLogonCommands section of the XML.
Here’s a step-by-step guide:
๐ฆ Collect installers: Grab the .exe or .msi files of the programs you want to install.
๐ฆ Silent switches: Find the command-line switches that allow silent installation.
For example:
/S
or /silent
for .exe installers
/quiet
for .msi installers
These switches make sure the installers don’t pop up any windows! ๐ก
On your installation media (like a USB stick), create a folder:
$OEM$\$1\Install
Copy all your installers (and any scripts) into this Install folder.
Open your autounattend.xml in a text editor. Under the oobeSystem pass, add the FirstLogonCommands section like this:
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Order>1</Order>
<CommandLine>cmd /c start /wait C:\Install\Program1.exe /S</CommandLine>
<Description>Install Program 1</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<CommandLine>cmd /c start /wait C:\Install\Program2.msi /quiet</CommandLine>
<Description>Install Program 2</Description>
</SynchronousCommand>
<!-- Add more as needed -->
</FirstLogonCommands>
Here’s what’s happening:
๐ข <Order>
– Sets the order of installations.
๐ข <CommandLine>
– Runs the installer silently.
๐ข <Description>
– Helpful note for each task.
๐พ Save your autounattend.xml at the root of your USB or ISO.
๐ฅ️ Boot from the media and watch the magic happen—your programs will install automatically during Windows setup! ๐
If you’re installing many programs, it’s easier to use a batch file:
1️⃣ Create install.bat
in C:\Install\
:
@echo off
start /wait C:\Install\Program1.exe /S
start /wait C:\Install\Program2.msi /quiet
start /wait C:\Install\Program3.exe /S
:: Add more lines as needed
exit
2️⃣ In your autounattend.xml, run the batch file:
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Order>1</Order>
<CommandLine>cmd /c C:\Install\install.bat</CommandLine>
<Description>Install All Programs</Description>
</SynchronousCommand>
</FirstLogonCommands>
This simplifies your XML—only one command to maintain! ๐
๐ง Program not installing?
Double-check silent switches. Not all installers support /S
—check their documentation!
๐ง Installer not found?
Paths in XML are absolute. Use C:\Install\
or %SystemDrive%\Install\
rather than relative paths.
๐ง Setup hangs or reboots mid-install?
Use start /wait
so each program finishes before the next.
Put heavy apps later in the order to avoid timeouts.
๐ง Installer UAC prompts?
The FirstLogonCommands
runs in admin context—no UAC should pop up, but make sure your installers are trusted.
๐ก Use DISM for driver injection: In the offlineServicing pass, use DISM commands to slipstream drivers.
๐ก Registry tweaks? – Add them under FirstLogonCommands
too, e.g. reg add
commands!
๐ก PowerShell support: You can run PowerShell scripts via:
<CommandLine>powershell.exe -ExecutionPolicy Bypass -File C:\Install\script.ps1</CommandLine>
PowerShell gives you more power and cleaner syntax. ⚡️
Imagine you’re setting up a new office PC. Here’s what your autounattend.xml might include:
✅ Chrome
✅ 7-Zip
✅ Office suite
✅ Slack
✅ Custom VPN
All installed during Windows setup—no extra work! ๐ข
These tools help craft or manage your autounattend.xml:
๐น Windows System Image Manager (WSIM) – Part of Windows ADK; visual editor for XML.
๐น Ntlite – Great for customizing Windows images, including app installs.
๐น Chocolatey – Add Chocolatey commands to your batch file for even easier deployments!
Example:
choco install 7zip -y
choco install vscode -y
๐ฆ Store your installers in a secure location.
๐ Check installer hashes (SHA256) to ensure integrity.
♻️ Keep your autounattend.xml updated as software versions change.
Before you roll out your image to many PCs:
✅ Test on a virtual machine (like Hyper-V)
✅ Watch the log files: C:\Windows\Panther\UnattendGC
for any errors
✅ Update any stale installers or switches
Once it’s polished, you’re ready to deploy at scale! ๐
✅ autounattend.xml can automate the boring stuff—no more clicking through installations manually.
✅ Silent switches are the key to no-interaction installs.
✅ Use batch files to keep XML clean and manageable.
✅ Tools like WSIM and Chocolatey make it even easier!
✅ Test, test, test—then deploy confidently. ๐
Using autounattend.xml to install multiple programs automatically is one of the best-kept secrets for Windows deployments. It’s not just a time-saver—it’s a way to ensure every system is consistent, secure, and ready to go.
๐ฏ Whether you’re an IT admin setting up dozens of laptops or a tech enthusiast refreshing your home PC, mastering this tool puts you ahead. ๐ช
Comments
Post a Comment