stevepedwards.com/DebianAdmin linux mint IT admin tips info

Create a Bootable Windows PE Image

First, download the Win7 AIK ISO from MS:

http://www.microsoft.com/en-gb/download/details.aspx?id=5753

The following steps are from the User Guide once installed.

Walkthrough: Create a Custom Windows PE Image

Walkthrough: Create a Custom Windows PE Image

This walkthrough describes how to create a customized Windows® PE image. The primary tool for customizing Windows PE 3.0 is Deployment Image Servicing and Management (DISM), a command-line tool. After creating a customized image, you can deploy the image to a hard disk or create a bootable Windows PE RAM disk on a CD-ROM, a USB flash drive (UFD), or a hard disk.

Note:
A Windows PE RAM disk boots directly into memory and is assigned the drive letter X, which does not necessarily correspond to the media (for example, a UFD or a CD-ROM) from which you booted. Ensure that you have sufficient memory to support the size of your Windows PE image plus any additional memory requirements, such as any customized applications that need additional working memory. The minimum RAM requirement for Windows PE is 512 MB.

Prerequisites

To complete this walkthrough, you need the following:

  • A technician computer that provides all the tools and source files necessary to create a customized Windows PE image. For more information, see Building a Technician Computer.
  • Custom applications.

Step 1: Set Up a Windows PE Build Environment

In this step, you create a directory structure that supports building a Windows PE image. This directory structure is required.

  1. On your technician computer, click Start, point to All Programs, point to Windows OPK or Windows AIK, right-click Deployment Tools Command Prompt and then select Run as administrator.
    The menu shortcut opens a Command Prompt window and automatically sets environment variables to point to all the necessary tools. By default, all tools are installed at C:\Program Files\version\Tools, where version can be Windows OPK or Windows AIK.
  2. At the command prompt, run the Copype.cmd script. The script requires two arguments: hardware architecture and destination location. For example,
    copype.cmd <architecture> <destination>

    where <architecture> can be x86, amd64, or ia64 and <destination> is a path to the local directory. For example,

    copype.cmd x86 c:\winpe_x86

    The script creates the following directory structure and copies all the necessary files for that architecture. For example,

    \winpe_x86
    \winpe_x86\ISO
    \winpe_x86\mount
  3. Copy the base image (winpe.wim) into \Winpe_x86\ISO\sources folder and rename the file to boot.wim.
    copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim

Step 2: Mount the Base Windows PE Image

In this step, you mount the base image to a local directory so that you can add or remove packages.

  1. At the command prompt, mount the base Windows PE image to the \Mount directory by using DISM. For example,
     
    Dism /Mount-Wim /WimFile:C:\winpe_x86\ISO\sources\boot.wim /index:1 /MountDir:C:\winpe_x86\mount

Step 3: Add Optional Components

In this step, you will add optional components using the DISM /AddPackage option. When adding optional components, you must include both the language neutral package and language specific package. Windows PE 3.0 provides the following Windows packages.

Package NameDescription
WinPE-FONTSupport-<region>Additional font support for the following languages: ja-JP, ko-KR, zh-CN, zh-HK, and zh-TW.
WinPE-HTAHTML Application support. Enables the creation of GUI applications using the Internet Explorer script engine and HTML services.
Winpe-LegacySetupThe Media Setup feature package. All Setup files from the \Sources folder on the Windows media. Add this package when servicing Setup or the \Sources folder on the Windows media. Must be added with the Setup feature package. To add a new Boot.wim to the media, add either child package in addition to the Setup and Media packages. This package is required to support Windows Server® 2008 R2 installation.
WinPE-MDACMicrosoft® Data Access Component support. Enables queries to SQL servers with Active Directory Objects (ADO). Example usage: building a dynamic Unattend from unique system information.
WinPE-PPPoEEnables Point-to-Point Protocol over Ethernet (PPPoE) support. Create, connect, disconnect and delete PPPoE connections from Windows PE.
WinPE-ScriptingWindows Script Host (WSH) support. Enables batch file processing using WSH script objects.
WinPE-SetupThe Setup feature package (parent). All Setup files from the \Sources folder common to Client and Server.
WinPE-Setup-ClientThe Client Setup feature package (child). The Client branding files for Setup. Must be added after the Setup feature package.
WinPE-Setup-ServerThe Server Setup feature package (child). The Server branding files for Setup. Must be added after the Setup feature package.
WinPE-SRTThe Windows Recovery Environment feature package. Provides a recovery platform for automatic system diagnosis and repair and the creation of custom recovery solutions.
WinPE-WMIWindows Management Instrumentation (WMI) support. A subset of the WMI providers that enables minimal system diagnostics.
WinPE-WDS-ToolsThe Windows Deployment Services tools feature package. Includes APIs to enable a multicast scenario with a custom Windows Deployment Services client and Image Capture utility.
Note:
The Windows PE-setup-package is the parent package of winpe-setup-client and winpe-setup-server. You must install winpe-setup before you install the child packages. The winpe-xml package is now included in the base boot.wim.
  1. Add a Windows package to your custom image using the DISM /Add-Package option. In this example, you add both the language neutral package and language specific package.
    Dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\<version>\Tools\PETools\<architecture>\WinPE_FPs\winpe-wmi.cab"
    Dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\<version>\Tools\PETools\<architecture>\WinPE_FPs\en-us\winpe-wmi_en-us.cab"
  2. Repeat Step 1 for each package you want to install in the base image.
  3. Verify that the packages were installed by using the DISM command with the /GetPackages option to view all packages in the current image. For example,
    Dism /image:c:\winpe_x86\mount /Get-Packages
    Note:
    When using DISM to list the feature packages in a Windows PE image, the packages will always be listed as “pending” even when the servicing operation was successful. This is by design and requires no further action from you.

Step 4: Add Language Support

In this step, you can optionally add language support to your custom Windows PE image using the DISM /Add-Package option. By default, additional Windows PE language packs are not installed on your technician computer. You can obtain additional language packs from your Windows OPK or Windows AIK media under the \WinPE_LangPacks folder.

  1. Add the Windows PE language pack into your working directory. For example,
    Dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\<version>\Tools\PETools\<architecture>\WinPE_FPs\en-us\lp_en-us.cab"
  2. Set the default language by using the /Set-AllIntl option with the following syntax. For example,
    Dism /image:C:\winpe_x86\mount /Set-AllIntl:en-US
  3. You can verify the language settings by using the /Get-Intl option. For example,
    Dism /image:c:\winpe_x86\mount /Get-Intl

Step 5: Add Additional Customizations

In this step, you can add applications and scripts to your Windows PE image that you might need while working in Windows PE. For more information see,

Step 6: Commit Changes to the Image

Commit changes to the image. In this step, you commit the changes to the original image file by using the DISM /unmount option with the /commit option. For example:

Dism /unmount-Wim /MountDir:C:\winpe_x86\mount /Commit

Next Step

You now have a customized Windows PE RAM disk image that you can place on bootable media, such as a CD-ROM or UFD.

To create a bootable CD-ROM

To create a bootable CD-ROM or DVD-ROM using custom Windows PE image, follow Step 4 of Walkthrough: Create a Bootable Windows PE RAM Disk on CD-ROM topic.

To create a bootable UFD

To create a bootable UFD using custom Windows PE image, follow Step 4 of Walkthrough: Create a Bootable Windows PE RAM Disk on UFD topic.
Walkthrough: Create a Bootable Windows PE RAM Disk on UFD

Walkthrough: Create a Bootable Windows PE RAM Disk on UFD

For DISKPART in PE you need to know these commands:
DISKPARTpe.jpg
As this is Disk1, you can follow the commands for fat32 formatting it below.

This walkthrough describes how you can create a bootable Windows® PE RAM disk on a USB flash drive (UFD) by using the Copype.cmd script. Windows PE RAM enables you to start a computer for the purposes of deployment or recovery. Windows PE RAM boots directly into memory, enabling you to remove the Windows PE media after boot.

Note:
This configuration boots directly into memory and is assigned the drive letter X, which does not correspond to the media (the UFD or CD-ROM) from which you booted. You can set the drive letter using the DISM /Set-TargetPath option. Ensure that you have sufficient memory to support the size of your Windows PE image, plus any additional memory requirements; for example, if you plan on running any customized applications that need additional working memory.

Prerequisites

To complete this walkthrough, you need the following:

  • A technician computer, which provides all of the tools and the source files. For more information, see Building a Technician Computer.
  • Access to a computer running Windows® 7 or a Windows PE session.
  • A UFD. The size of the UFD must be at least 64 megabytes (MB) larger than your Windows PE image, plus the size of any additional files that you include.

Step 1: Set up a Windows PE build environment

In this step, you create a required directory structure that supports building a Windows PE image.

  1. On your technician computer, click Start, point to All Programs, point to Windows OPK or Windows AIK, right-click Deployment Tools Command Prompt, and then select Run as administrator.
    The menu shortcut opens a command-prompt window and automatically sets environment variables to point to all of the necessary tools. By default, all tools are installed at C:\Program Files\<kit>\Tools, where <kit> can be Windows OPK or Windows AIK.
  2. At the command prompt, run the Copype.cmd script. The script requires two arguments: hardware architecture and destination location.
    copype.cmd <arch> <destination>

    where <arch> can be x86, amd64, or ia64 and <destination> is a path to local directory. For example,

    copype.cmd x86 c:\winpe_x86

    Running the script creates the following directory structure and copies all of the necessary files for that architecture. For example,
    \Winpe_x86
    \Winpe_x86\ISO
    \Winpe_x86\Mount

  3. Copy the base image (Winpe.wim) into the \Winpe_x86\ISO\sources folder, and rename the file to Boot.wim.
    copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim

Step 2: Add additional customizations

This step is optional but recommended.

You can use ImageX to add applications and scripts to your Windows PE image that you might need while working in Windows PE. ImageX is a tool for capturing and applying images during deployment scenarios. For example, type the following command to copy the ImageX tool to the Windows PE image.

copy “c:\program files\<version>\Tools\x86\ImageX.exe” c:\winpe_x86\iso\

Step 3: Prepare the UFD

Before you can place Windows PE on a UFD, you must format the UFD using the version of DiskPart from Microsoft Vista, Windows 7 or Windows PE 2.0 or higher.

  1. From a running valid operating system or Windows PE session, insert your UFD.
  2. At a command prompt, use Diskpart to format the UFD as FAT32 spanning the entire UFD, and set the partition as active. For example,
    diskpart
    select disk 1
    clean
    create partition primary
    select partition 1
    active
    format quick fs=fat32
    assign
    exit

    The example above assumes Disk 1 is the UFD.

  3. On your technician computer, copy all of the content in the \ISO directory onto your UFD. You can manually create the directory structure or use the xcopy command to automatically build and to copy the appropriate files from your technician computer to your UFD. For example,
    xcopy c:\winpe_x86\iso\*.* /e f:\

    where c is the letter of your technician computer hard disk, and f is the letter of your UFD.

Next Step

You can also place Windows PE RAM on other bootable media, such as a CD-ROM or a hard disk. For more information, see Windows PE Walkthroughs.

To load an application or a script into memory with Windows PE, you must create a custom Windows PE image. For more information, see Walkthrough: Create a Custom Windows PE Image.

Walkthrough: Create a Bootable Windows PE RAM Disk on CD-ROM

Walkthrough: Create a Bootable Windows PE RAM Disk on CD-ROM

This walkthrough describes how you can create a bootable Windows® PE RAM disk on CD-ROM or DVD-ROM by using the Copype.cmd script. Windows PE RAM enables you to start a computer for the purposes of deployment and recovery. Windows PE RAM boots directly into memory, enabling you to remove the Windows PE media after the computer boots.

Note:
This configuration boots directly into memory and is assigned the drive letter X, which does not correspond to the media, USB flash drive (UFD) or CD-ROM, from which you booted. You can set the drive letter using the DISM /Set-TargetPath option. Ensure that you have sufficient memory to support the size of your Windows PE image plus any additional memory requirements; for example, if you plan on running customized applications that need additional working memory.

Prerequisites

To complete this walkthrough, you need the following:

  • A technician computer, which provides all the tools and the source files. For more information, see Building a Technician Computer.
  • CD-ROM or DVD-ROM burning software. The Windows OEM Preinstallation Kit (Windows OPK) and Windows Automated Installation Kit (Windows AIK) do not include CD-ROM or DVD-ROM burning software. However, you can obtain burning software from the Windows 2003 Resource Kit (cdburn and dvdburn) or use any third-party software.
  • A blank CD-ROM or DVD-ROM.

Step 1: Set up a Windows PE build environment

In this step, you create a required directory structure that supports building a Windows PE image.

  1. On your technician computer, click Start, point to All Programs, point to Windows OPK or Windows AIK, right-click Deployment Tools Command Prompt, and then select Run as administrator.
    The menu shortcut opens a Command Prompt window and automatically sets environment variables to point to all the necessary tools. By default, all tools are installed at C:\Program Files\<version>\Tools, where <version> can be Windows OPK or Windows AIK.
  2. At the command prompt, run the Copype.cmd script.
    The script requires two arguments: hardware architecture and destination location. For example,
    copype.cmd <architecture> <destination>
    where <architecture> can be x86, amd64, or a64, and <destination> is a path to a local directory. For example,
    copype.cmd x86 c:\winpe_x86
    The script creates the following directory structure and copies all the necessary files for that architecture. For example,
    \winpe_x86
    \winpe_x86\ISO
    \winpe_x86\mount
  3. Copy the base image (Winpe.wim) to the \Winpe_x86\ISO\sources folder and rename the file to Boot.wim.
    copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim

Step 2: (Optional) Add additional customizations

This step is optional, but recommended.

Using ImageX, you can add applications and scripts to your Windows PE image that you might need while working in Windows PE. ImageX is a tool for capturing and applying images during deployment scenarios. For example, at a command prompt, type:

copy "C:\program files\<version>\Tools\<architecture>\imagex.exe" C:\winpe_x86\iso\

where <version> can be Windows OPK or Windows AIK, and <architecture> can be x86, amd64, or a64. In both of the previous examples, the tools are not loaded into memory during a Windows PE RAM boot. The media must be available to access the tools.

Step 3: Create a bootable CD-ROM

This step describes how to put a Windows PE RAM disk onto a CD-ROM. This option requires that you create an .iso file by using the Oscdimg tool.

  1. On your technician computer, create an .iso file with Oscdimg. At a command prompt, type:
    oscdimg -n -bC:\winpe_x86\etfsboot.com C:\winpe_x86\ISO C:\winpe_x86\winpe_x86.iso
    Note:
    To remove the "Press any key to boot from CD" prompt during boot, remove the bootfix.bin file from the \boot folder within your mounted image.

    For EFI based system or Itanium-based architecture, replace Etfsboot.com with Efisys.bin. The Oscdimg tool is not supported on an Itanium-based computer running Windows Server 2003.
    To build an AMD64 EFI .iso file, use the following commands:

    oscdimg.exe -bC:\winpe_x64efi\efisys.bin -u2 -udfver102 C:\winpe_x64efi\ISO C:\winpe_x64efi \winpex64efi.iso
  2. Burn the image (.iso) onto a CD-ROM or DVD-ROM.

Commands showing the successful creation of the ISO:

x86iso.jpg

Now you have a bootable image that works across the network using the menus:

label 4
menu label ^4) WinPE_x86
kernel memdisk
initrd WinPE_x86/winpe_x86.iso
APPEND iso raw
label 5
menu label ^5) WinPE_amd64
kernel memdisk
initrd WinPE_amd64/winpe_amd64.iso
APPEND iso raw

You could remake the ISOs without the bootfix.bin file to remove the need to press any key at boot, and work out a way bake in an autoexec.bat file along the lines of:

ping dellmint
net use
net use s: \\dellmint\Quadra
s:
cd Win7
setup.exe

that takes a couple more manual sets out of the PE commands required to get to the Win7 Install menu, although you still have to net use S: to map the initial linux share locally to the PE.

Comments are closed.

Post Navigation