Unattended installation for windows 7 x86

6,729

Solution 1

The following autounattended.xml file can be used to full automate the Windows 7 installation.

It will:

  • Create a single partition for the boot, system, crash dump and primary partition
  • Enter the product key
  • Enter the organisation information
  • Configure Internet Explorer 8
  • Disable the information bar
  • Disable the Internet accelerators
  • Disable the developer tools
  • Disable the first run message
  • Set www.google.com.au as the homepage
  • Set Google Australia as the default search provider
  • Set the firewall to option 3 – Work
  • Enable the ‘Administrator’ account
  • Set the ‘Administrator’ password to ‘password’
  • Create a local administrator account called ‘UserName’ with the password of ‘password’
  • Prompt for a computer name (will not prompt for a new user account)

Before being able to successfully use this unattended file, you will need to change:

  • Product Key
  • Organisation information
  • local administrator password
  • ‘UserName’ local administrator account name and password

Autounattend.xml:

 <?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="windowsPE">
        <component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <ImageInstall>
                <OSImage>
                    <WillShowUI>Never</WillShowUI>
                    <InstallTo>
                        <DiskID>0</DiskID>
                        <PartitionID>1</PartitionID>
                    </InstallTo>
                </OSImage>
            </ImageInstall>
            <UserData>
                <ProductKey>
                    <WillShowUI>Never</WillShowUI>
                    <Key>XXXX-XXXX-XXXX-XXXX-XXXX</Key>
                </ProductKey>
                <FullName>Information Technology Services</FullName>
                <Organization>Organisation Name</Organization>
                <AcceptEula>true</AcceptEula>
            </UserData>
            <DiskConfiguration>
                <WillShowUI>Never</WillShowUI>
                <Disk>
                    <DiskID>0</DiskID>
                    <WillWipeDisk>true</WillWipeDisk>
                    <CreatePartitions>
                        <CreatePartition>
                            <Order>1</Order>
                            <Type>Primary</Type>
                            <Extend>true</Extend>
                        </CreatePartition>
                    </CreatePartitions>
                </Disk>
            </DiskConfiguration>
        </component>
    </settings>
    <settings pass="specialize">
        <component name="Microsoft-Windows-Deployment" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <RunSynchronous>
                <RunSynchronousCommand wcm:action="add">
                    <Path>net user administrator /active:yes</Path>
                    <Order>1</Order>
                </RunSynchronousCommand>
            </RunSynchronous>
        </component>
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <ShowWindowsLive>false</ShowWindowsLive>
        </component>
        <component name="Microsoft-Windows-IE-InternetExplorer" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <FilterLevel>High</FilterLevel>
            <ShowInformationBar>false</ShowInformationBar>
            <DisableAccelerators>true</DisableAccelerators>
            <DisableDevTools>true</DisableDevTools>
            <DisableFirstRunWizard>true</DisableFirstRunWizard>
            <DisableOOBAccelerators>true</DisableOOBAccelerators>
            <Home_Page>http://www.google.com.au</Home_Page>
            <SearchScopes>
                <Scope wcm:action="add">
                    <ScopeDefault>true</ScopeDefault>
                    <ScopeDisplayName>Google</ScopeDisplayName>
                    <ScopeKey>SearchProvider1</ScopeKey>
                    <ScopeUrl>http://www.google.com.au/search?q={searchTerms}</ScopeUrl>
                </Scope>
            </SearchScopes>
        </component>
        <component name="Microsoft-Windows-ErrorReportingCore" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DisableWER>1</DisableWER>
        </component>
    </settings>
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <OOBE>
                <ProtectYourPC>3</ProtectYourPC>
                <NetworkLocation>Work</NetworkLocation>
                <SkipMachineOOBE>true</SkipMachineOOBE>
                <SkipUserOOBE>false</SkipUserOOBE>
            </OOBE>
            <UserAccounts>
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                        <Password>
                            <Value>password</Value>
                            <PlainText>true</PlainText>
                        </Password>
                        <Name>UserName</Name>
                        <Group>Administrators</Group>
                    </LocalAccount>
                </LocalAccounts>
                <AdministratorPassword>
                    <Value>password</Value>
                    <PlainText>true</PlainText>
                </AdministratorPassword>
            </UserAccounts>
            <TimeZone>Eastern Standard Time</TimeZone>
        </component>
    </settings>
</unattend>

Source: Windows 7 Autounattend Example

Solution 2

You can also use a utility like RT7Lite to create an unattended installation of Windows, similar to the older nLite for Windows XP. You can also remove unnecessary components and features from the operating system, and removing them from the installation itself.

Depending on what you want/need to remove, you can drastically reduce the size of the installed operating system. However, if you just need the Autounattend.xml file, you can run through the entire build process and extract the final file from the resulting disc image.

Share:
6,729

Related videos on Youtube

user448402
Author by

user448402

Updated on September 18, 2022

Comments

  • user448402
    user448402 about 1 year

    Are there any pre-created Autounattend.xml files for Windows 7 unattended installation x86? I have been experimenting and creating the XML file but I am always being prompted to choose which hard disk to format. I can't seem to add in the script to automate that process.

    I tried adding the DiskConfiguration portion but the installation keeps giving me error that my diskID is incorrect.

    How do I resolve this issue? Is there any pre-created Autounattend.xml file that automates everything?

    I want it to work for VMware virtual machine. Currently, VMware creates its own default disk. So RT Seven Lite only works for normal computer and not VMware.

    • Admin
      Admin over 12 years
      When you say VMWare creates it's own default disk, do you mean it formats the disk with a filesystem? (I apologize, I am only familiar with VirtualBox)
    • Admin
      Admin over 12 years
      @Breakthrough No it does not format the disk with a filesystem, I have to use the Autounattend.xml to specify the format type. What I meant was VMware creates its own default disk without any partition which is 'Disk0 Unallocated Space'. Btw Here the link to my Autounattend.xml script: pastebin.com/dGjap3Wf.
  • user448402
    user448402 over 12 years
    am getting this error: Windows could not set a partition active on disk0. The specified partition does not exist on the target disk. The error occurred while applying the unattended answer file’s <DiskCongifuration> settings.
  • user448402
    user448402 over 12 years
    I have a working Autounattend.xml file that automates everything but only prompt at the selecting the disk 0 unallocated space part.
  • user448402
    user448402 over 12 years
    But it does not work for VMware. How shall i customize it?
  • Rocket04
    Rocket04 over 12 years
    @user448402 you need to include <ImageInstall> and <DiskConfiguration> tags as per ovann86's answer. IIRC, RT7Lite creates these tags for you when you go through the unattended procedure if you configure disk formatting properly...
  • user448402
    user448402 over 12 years
    I added those tags but it works for normal windows installation and not on Virtual machine. It did not detect the DiskConfiguration tag.
  • user448402
    user448402 over 12 years
    @ovan86 it keeps asking me to selecting which hard disk I wish to install the operating system in my Virtual Machine. I wish to automate that process.
  • user448402
    user448402 over 12 years
    what should i do?
  • ovann86
    ovann86 over 12 years
    I've only seen this before where the autounattend file wasn't being detected at all. If you manually specify the parition information does the rest of the unattend information get applied?
  • slhck
    slhck over 9 years
    Add the necessary information here, on the site, not just in a link, please.