The first step is to download the Windows AIK for Windows 7 or the latest ADK for Windows 8/8.1. Install Windows AIK on any compatible system (preferably not the system being imaged) and open the Windows System Image Manager on the Start Menu.
- Under the ‘Windows Image’ heading (bottom left) right click on ‘Select a Windows image or catalog file’, you will be presented with a file open dialogue.
- Insert your Windows 7 (Enterprise) DVD/image and locate the following file: ‘…:\sources\install_Windows 7 ENTERPRISE.clg’ images
- In the File menu select to ‘Create a New Answer File’
Settings:
- In the ‘Windows Image’ area (bottom left) select ‘amd64_Microsoft-Windows-Security-SPP_6.1.7600.16385_neutral’ (amd64 may also be x86 if you installed in 32bit) right-click it and select ‘Add to parse 3 generalize’.
- This moves this option into our answer file. Now select this item in the main window, this will show you the possible configuration options in the ‘Properties’ window on the right.
- Set ‘SkipRearm’ to 1.
Hint: Technically this should overwrite the Windows 7 rearm limit from 3 to unlimited.
Note: Setting the SkipRearm to 0 will reset the Activation grace-period timer. Configure this setting before finalizing (last SysPrep process) and deploying an image. - Select amd64_Microsoft-Windows-Deployment_6.1.7600.16385_neutral into parse 4 specialize
- Right-click on RunSynchronous and add a command, then select ‘RunSynchronousCommand[Order="1"]’ and in Properties add the following:
- Order: 1
- Path: net user administrator /active:yes
- WillReboot: Never
- Select amd64_Microsoft-Windows-Security-SPP-UX_6.1.7600.16385_neutral into parse 4 specialize
- SkipAutoActivation: false (false will ensure that if you have used a volume license key Windows will automatically activate for you)
- Select amd64_Microsoft-Windows-Shell-Setup_6.1.7600.16385_neutral into parse 4 specialize
- Computer Name: Leave blank
- CopyProfile: true
- Registered Organization: Microsoft (you must leave this in this section)
- Registered Owner: AutoBVT (you must leave this in this section)
Info: AutoBVT stands for Auto Build Verification Test. This is an account which was required upon SysPrep in order to verify that the SysPrep operation completed successfully. - ShowWindowsLive: false (do not select this when preparing for Windows 8/8.1)
- TimeZone: GMT Standard Time (Must be spelt exactly according to TimeZone settings here from Microsoft’s website)
- Select amd64_Microsoft-Windows-International-Core_6.1.7600.16385_neutral into parse 7 oobeSystem
- InputLocale: en-US
- SystemLocale: en-US
- UILanguage: en-US
- UserLocale: en-US
- Language settings can be found here
- Select amd64_Microsoft-Windows-Shell-Setup_6.1.7600.16385_neutral into parse 7 oobeSystem
- RegisteredOrganization: Your Company Name
- RegisteredOwner: Your Name
- AutoLogon
- Enabled: true
- LogonCount: 5 (this will automatically log into the following account this number of times after setup so you can easily perform other software activations etc. Logging out will override this setting.)
- Username: administrator
- Password: Administrator Password
- FirstLogonCommands (right-click and add 2)
- SynchronousCommand[Order="1"]
- CommandLine: cscript /b c:\windows\system32\slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX (Windows 7 license key)
- CommandLine: cscript /b c:\windows\system32\slmgr.vbs /skms KMS-servername:port (when using a KMS Server)
- Order: 1
- RequiresUserInput: false
- SynchronousCommand[Order="2"]
- CommandLine: cscript //b c:\windows\system32\slmgr.vbs /ato
- Order: 2
- RequiresUserInput: false
- OOBE
- HideEULAPage: true
- NetworkLocation: Work
- ProtectYourPC: 1
- UserAccounts
- AdministratorPassword: Administrator Password
- On LocalAccounts, right-click and select action: AddListItem (this automatically creates a local Admin account) LocalAccount[Name="Administrator"]
- Description: Local Administrator
- DisplayName: Administrator
- Group: Administrators
- Name: Administrator
- Password: Administrator Password
Copy the unattend.xml file into the C:\windows\system32\sysprep directory.
Important Security Information
Any passwords you have set in the answer file are stored unencrypted. Ensure you protect this file, especially if you entered a local administrator account password.
Create a script to remove the unattend.xml file after deployment
On the deployment base image computer open Notepad and enter in the following lines:
del /Q /F c:\windows\system32\sysprep\unattend.xml
del /Q /F c:\windows\panther\unattend.xml
These lines of code will delete the unattend.xml file from the computer once the Windows Setup is finished with them (this file is copied into the panther directory during setup hence the two lines). Save this file to the desktop called SetupComplete.cmd (ensure to change the file type from .txt to all types so the file doesn’t get saved as SetupComplete.cmd.txt). Now create a folder called Scripts in this directory: C:\Windows\Setup\ and drag this file into it (you may be prompted for Administrator authority).
Hint: Windows will automatically check for the existence of this file and run it after Windows Setup has completed.