Home Blog About Me Resume

Automating Windows Installation with Answer Files

Introduction to Windows Answer Files

Using answer files allows for an efficient, automated Windows installation, reducing manual steps and ensuring consistency. Here, we’ll look at two scenarios: automating a basic Windows 10 installation and a more complex imaging and cloning setup.

Scenario 1: Basic Windows 10 Installation Automation

This scenario involves creating an answer file to automate the standard installation of Windows 10 from a USB drive.

  1. Create the Answer File: Use Windows Answer File Generator to generate your custom answer file.
  2. Prepare a Bootable USB: Download the Windows 10 ISO file and burn it to a USB drive.
  3. Place the Answer File on the Drive: Add the answer file to the root of the USB drive.
  4. Begin Automated Installation: Boot the target PC from the USB to start the automated installation process.
Windows Answer File Setup

Fig 1: Using Windows Answer File Generator

Windows 10 ISO Creation

Fig 2: Creating Windows 10 ISO

Burning ISO to USB

Fig 3: Burning ISO to USB Drive

Adding Answer File to USB

Fig 4: Adding Answer File to USB Drive

Automated Windows Installation

Fig 5: Automated Windows Installation Process

Booting Automated Windows Installation

Fig 6: Booting into Windows for Automated Installation

Scenario 2: Advanced Imaging and Cloning Automation

This advanced scenario involves using an answer file to automate the imaging and cloning process, along with detailed disk partitioning commands.

  1. Mount the Windows Image: Prepare the image by mounting it to customize.
  2. Place the Answer File: Copy the answer file into the Windows/Panther folder of the mounted image.
  3. Execute Partitioning Commands: Use commands such as diskpart to set up partitions and format them.
    • Select disk 0 and clean
    • Create EFI, MSR, and primary partitions
    • Format as fat32 or ntfs as required
    • Set up a recovery partition and apply attributes
  4. Apply the Windows Image: Use Dism commands to apply the Windows image.
Mounting Windows Image

Fig 7: Mounting the Windows Image

Unmounting Windows Image

Fig 8: Unmounting the Windows Image

Partition Commands Used

Below are the primary commands used to manage disk partitions and prepare the system for imaging:

  1. select disk 0
  2. clean
  3. convert gpt
  4. create partition efi size=100
  5. format quick fs=fat32 label="System"
  6. assign letter="S"
  7. create partition msr size=16
  8. create partition primary
  9. shrink minimum=500
  10. format quick fs=ntfs label="Windows"
  11. assign letter="W"
  12. create partition primary
  13. format quick fs=ntfs label="Recovery"
  14. assign letter="R"
  15. set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
  16. gpt attributes=0x8000000000000001
Partitioning Disk Setup

Fig 9: Partitioning Disk Setup

Applying the Windows Image

After setting up partitions, apply the Windows image using Dism and run system checks.

Applying the Windows Image

Fig 10: Applying the Windows Image

System Verification

Fig 11: System Verification with sfc /scannow