Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
programming4us
Windows 7

Automating the Windows 7 Installation : Deploying Unattended Installations (part 1)

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
7/4/2011 7:00:11 PM
You can deploy Windows 7 installations or upgrades through a Windows 7 distribution DVD or through a distribution server that contains Windows 7 images and associated files, such as Unattend.xml for unattended installations. Using a DVD can be advantageous if the computer on which you want to install Windows 7 is not connected to the network or is connected via a low-bandwidth network. It is also typically faster to install a Windows 7 image from DVD than to use a network connection.

Unattended installations rely on options configured in an answer file that is deployed with the Windows 7 image. Answer files are XML files that contain the settings that are typically supplied by the installer during attended installations of Windows 7. Answer files can also contain instructions for how programs and applications should be run.

The Windows Setup program is run to install or upgrade to Windows 7 from computers that are running compatible versions of Windows.

The Windows Setup program (Setup.exe) replacesWinnt32.exe andWinnt.exe, which are the setup programs used in versions of Windows prior to Windows Vista. Although it's a graphical tool, Windows Setup can be run from the command line. For example, you can use the following command to initiate an unattended installation of Windows 7:

setup.exe /unattendianswerfile

The Windows Setup program has several command-line options that can be applied. Table 1 describes the Setup.exe command-line options.

Table 1. Setup. exe command-line options and descriptions
Setup.exe OptionDescription
/1394debug: channel [baudrate:baudrate]Enables kernel debugging over a FireWire (IEEE 1394) port for troubleshooting purposes. The [baudrate] optional parameter specifies the baud rate for data transfer during the debugging process.
/debug: port [baudrate: baudrate]Enables kernel debugging over the specified port for troubleshooting purposes.The [baudrate] optional parameter specifies the baud rate for data transfer during the debugging process.
/dudisableUsed to prevent a dynamic update from running during the installation process.
/emsport:(comllcom2Iusebiossettingsloff)[/emsbaudrate:baudrate]Configures EMSto be enabled or disabled. The [baudrate] optional parameter specifies the baud rate for data transfer during the debugging process.
/m:folder_nameUsed with Setup to specify that replacement files should be copied from the specified location. If the files are not present, Setup will use the default location.
/norebootNormally, when the down level phase of Setup. exe is complete, the computer restarts. This option specifies that the computer should not restart so that you can execute another command prior to the restart.
Itempdri ve: drive letterSpecifies the location that will be used to store the temporary files for Windows 7 and the installation partition for Windows 7.
lunattend: [answerfile]Specifies that you will be using an unattended installation for Windows 7. The answerfi1e variable points to the custom answer file you will use for installation.

Next we'll look at the System Preparation Tool (Sysprep); using it is one of many ways to install Windows 7 automatically.

1. Using the System Preparation Tool to Prepare an Installation for Imaging

You can use disk images to install Windows 7 on computers that have similar hardware configurations. Also, if a computer is having technical difficulties, you can use a disk image to quickly restore it to a baseline configuration.

To create a disk image, you install Windows 7 on the source computer with the configuration that you want to copy and use the System Preparation Tool to prepare the installation for imaging. The source computer's configuration should also include any applications that should be installed on target computers.

Once you have prepared the installation for imaging, you can use imaging software such as ImageX to create an image of the installation.

The System Preparation Tool (Sysprep.exe) is included with Windows 7, in the %WINDIR%\system32\sysprep directory. When you run this utility on the source computer, it strips out from the master copy information that must be unique for each computer, such as the SID. Table 2 defines the command options that you can use to customize the Sysprep.exe operation.

Table 2. System preparation command-line options
SwitchDescription
/auditConfigures the computer to restart into audit mode, which allows you to add drivers and applications to Windows or test the installation prior to deployment
/generalizeRemoves any unique system information from the image, including the SID and log information
/oobeSpecifies that the Windows Welcome screen should be displayed when the computer reboots
/quietRuns the installation with no user interaction
/quitSpecifies that the System Preparation Tool should quit after the specified operations have been completed
/rebootRestarts the target computer after the System Preparation Tool completes
/shutdownSpecifies that the computer should shut down after the specified operations have been completed
/unattendIndicates the name and location of the answer file to use

In the following sections, you will learn how to create a disk image and how to copy and install from it.

1.1. Preparing a Windows 7 Installation

To run the System Preparation Tool and prepare an installation for imaging, take the following steps:

  1. Install Windows 7 on a source computer. The computer should have a similar hardware configuration as the destination computer(s). The source computer should not be a member of a domain.

  2. Log on to the source computer as an administrator and, if desired, install and configure any applications, files (such as newer versions of Plug and Play drivers), or custom settings (for example, a custom Desktop) that will be applied to the target computer(s).

  3. Verify that your image meets the specified configuration criteria and that all applications are properly installed and working.

  4. Select Start => Computer, and navigate to C:\WINDIR%\System32\sysprep. Doubleclick the Sysprep application icon.

  5. The Windows System Preparation Tool dialog box appears. Select the appropriate options for your configuration.

  6. If configured to do so, Windows 7 will be rebooted into setup mode, and you will be prompted to enter the appropriate setup information.

  7. You will now be able to use imaging software to create an image of the computer to deploy to other computers.

In Exercise 1, you will use the System Preparation Tool to prepare the computer for disk imaging. The Sysprep utility must be run on a machine with a clean version of Windows 7. If you upgraded a Windows Vista machine to Windows 7, you will not be able to run the Sysprep utility.

Exercise 1: Using the System Preparation Tool

  1. Log on to the source computer as Administrator and, if desired, install and configure any applications that should also be installed on the target computer.

  2. Select Start => Computer, and navigate to C:\%WINDIR%\System32\sysprep. Doubleclick the Sysprep application icon.

  3. In the System Preparation Tool dialog box, select Enter System Out-Of-Box Experience (OOBE) in the system cleanup action.

  4. Under the shutdown options, depending on the options selected, the System Preparation Tool will quit, the computer will shut down, or the computer will be rebooted into setup mode, where you will need to configure the setup options. Choose the Reboot option. Click OK.

  5. Configure the Sysprep utility and name the image image.wim.


After creating the Sysprep image, you need to use some type of third-party software to install it. Windows includes a utility called ImageX for just that purpose.

2. Using ImageX to Create a Disk Image

After you've run the System Preparation Tool on the source computer, you can create an image from the installation, and you can then install the image on target computers.

To create an image, you can use ImageX, which is a command-line utility that can be used to create and manage Windows image (.wim) files.

2.1. Creating a Disk Image

To run the ImageX utility to create a disk image of a Windows 7 installation, follow these steps:

  1. Reboot the computer into the Windows Reinstallation Environment (PE).

  2. At the resulting command prompt, access the ImageX utility by typing D:\Tools\ ImageX and entering the appropriate options. For example, to create an image named Windows 7, you could enter the following command:

    D:\ImageX.exe /capture C: C:\Images\image.wim "Windows 7" /verify

  3. You can copy the new image to a network share or to the local computer for hardware disk duplication. To copy the image to a network share, you can use the net use dir network share command along with the copy file dir command to copy the file.

In Exercise 2, you will use the ImageX utility to create a disk image of a Windows 7 installation.

Exercise 2: Using the ImageX Utility to Create a Disk Image

  1. Boot the computer into the Windows Preinstallation Environment (Windows PE).

  2. Type the following command in Windows PE, assuming that your DVD\CD drive is configured asthe D: drive:

    D:\ImageX.exe /capture C: C:\Images\image, wim "Windows 7" /verify

  3. Copy the new image to a network share at \\Server\Images by using the following commands:

    net use z: \\Server\Images

    copy C:\Images\image.wim z:


After you create the disk image, the next step is to install the disk image. In the next section, you'll learn to install the disk image to a new machine.

3. Installing from a Disk Image

After you've run the System Preparation Tool and ImageX on the source computer, you can copy the image and then install it on the target computer.

After the image is copied, you should boot the destination computer into the Windows Reinstallation Environment (Windows PE). If the computer has been used previously, it may be necessary to reformat the hard drive, which you can do using the disk part command in Windows PE. If the image is stored over the network, you should then copy the image to the destination computer by using the net use [dir] [network snare] and copy [file] [dir] commands. Then, you should use the /apply option of the ImageX utility to apply the image to the local computer. If an answer file has not been deployed along with the image, you may have to apply such information as regional settings, the product key, the computer name, and the password to the new computer after the destination computer is rebooted.

In Exercise 3, you will use the stripped image that was created in Exercise 2 to simulate the process of continuing an installation from a disk image.

Exercise 3: Installing Windows 7 from a Disk Image

  1. Boot the target computer into the Windows PE environment.

  2. Copy the image created in Exercise 2.4 to the local computer by using the following commands:

    net use z: \\Server\Images copy

    Z:\Images\image.wim C:

  3. Apply the image to the target computer using the following ImageX command:

    D:\ImageX.exe /apply C:\Images\image.wim C:


When you install Windows 7, the installation wizard asks you questions such as your username and computer name. There is a way to answer these questions without actually being in front of the computer. As you'll see in the next section, you can do this by using an answer file.
Other -----------------
- Microsoft Visio 2010 : Understanding Organization Charts & Building an Organization Chart by Hand
- Microsoft Visio 2010 : Creating Swimlane Diagrams
- Microsoft Excel 2010 : Editing Chart Data
- Microsoft Excel 2010 : Changing the Chart Background & Enhancing a Chart
- Microsoft Excel 2010 : Formatting Chart Text & Formatting Line and Bar Charts
- Visual Studio 2010 : Building the Windows Container (part 3) - Creating a Multiple Document Interface
- Visual Studio 2010 : Building the Windows Container (part 2) - Adding menus and toolbars
- Visual Studio 2010 : Building the Windows Container (part 1) - Setting common form properties & Creating dialog boxes
- Microsoft Visio 2010 : Adding Labels to Flowcharts & Understanding Swimlane Diagrams
- Microsoft Visio 2010 : Selecting a Flowchart Type & Creating Flowcharts
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server