How to Install Multiple Programs Automatically with autounattend.xml

๐Ÿ’ป How to Install Multiple Programs Automatically with autounattend.xml

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. ๐Ÿ› ️

How to Install Multiple Programs Automatically with autounattend.xml

๐Ÿš€ What is autounattend.xml?

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. ๐Ÿข


⚡️ Why Use autounattend.xml for Multiple Programs?

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. ๐Ÿ†


๐Ÿ“ Basic Structure of autounattend.xml

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! ⚡️


๐Ÿ—️ Setting Up autounattend.xml for Multiple Programs

To install programs during setup, we use the FirstLogonCommands section of the XML.

Here’s a step-by-step guide:


1️⃣ Prepare Your Programs

๐Ÿ“ฆ 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! ๐Ÿ’ก


2️⃣ Create a Setup Folder

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.


3️⃣ Edit autounattend.xml

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.


4️⃣ Save and Test!

๐Ÿ’พ 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! ๐ŸŒˆ


๐Ÿงช Adding More Complexity: Scripts and Batch Files

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! ๐Ÿ‘Œ


๐Ÿ› ️ Troubleshooting Common Issues

๐Ÿ”ง 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.


๐Ÿ’ก Pro Tips for Power Users

๐Ÿ’ก 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. ⚡️


๐Ÿ’ผ Use Case Example

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! ๐Ÿข


๐Ÿ”ฅ Going Beyond: Tools to Supercharge Deployment

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

๐Ÿ›ก️ Security and Maintenance

  • ๐Ÿ“ฆ Store your installers in a secure location.

  • ๐Ÿ”’ Check installer hashes (SHA256) to ensure integrity.

  • ♻️ Keep your autounattend.xml updated as software versions change.


๐Ÿš€ Final Steps: Validate and Deploy

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! ๐Ÿ†


๐Ÿ’ก Key Takeaways

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. ๐Ÿš€


✨ Wrapping Up

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