pause
The process I am going to describe is for a 32 bit WinPE boot system, but the WAIK contains the sources for AMD64 and IA64 boot systems as well, and the process scripts can readily be amended to use these sources instead.
** This command generates an ISO image of the boot environment you have created, in the form of the Winpe_x86.iso file located in the c:\winpe_x86 folder. (C:\Program Files\Windows AIK\Tools\Servicing) should be added to the system path on your test machine, and the machine rebooted. dism.exe /image:c:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-mdac_en-us.cab" ** This command is optional, but deleting bootfix.bin will remove the prompt “Press any key to boot from CD or DVD” when the iso image is booting.3. dism.exe /Mount-Wim /WimFile:c:\winpe_x86\winpe.wim /index:1 /MountDir:c:\winpe_x86\mount
Adding these packages in manually from the command line continually resulted in errors, and I believe that the cause of this was the loss of the environment settings created by copype.cmd, as running exactly the same commands from within this script does result in a successful addition of these packages.
9. copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim
dism.exe /image:c:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-wmi_en-us.cab"
However, the procedure outlined for creating the bootable iso in the Microsoft document WinPE.CHM at the default location of: C:\Program Files\Windows AIK\Docs\CHMs just did not want to work for me, and it took me a while to find the solution.
Type EXIT at the WinPE command prompt and wait for the system bios message to appear on the test workstation as it reboots. Press the appropriate function key to allow selection of the boot device, and when the boot list is displayed, select the USB device and boot from it. If all went well, the standard WinPE boot should commence. Wait until the X:\Windows\System32> prompt is displayed, and then type EXIT to reboot your system, as the boot test is now complete.
pauseREM dism.exe /image:c:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-setup_en-us.cab" ** This command copies the finalised image to the location from which an ISO will be created, and renames it to boot.wim, which is the standard name for this file in the ISO.
REM dism.exe /image:c:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-setup-client_en-us.cab"
copy "C:\Program Files\Windows AIK\Tools\x86\imagex.exe" "c:\winpe_x86\mount\Windows\System32"
While you are doing this, you may also wish to download the SP1 supplement (1.25Gb) from here:
dism.exe /image:c:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-PPPOE_en-us.cab"
The following procedure applies, with minor differences, to both USB flash memory devices, and USB hard disks. Some command can be abbreviated and where this is possible, the abbreviations are shown in brackets.
At the WinPE command prompt, type:
With the arrival of Windows 7, Microsoft have released an updated version of WinPE, currently versioned as V3.1, which is based on the Windows 7 kernel.
** There are a number of pairs of dism commands to Add Packages to the template image – some are remarked out, as they are not too relevant to the utility disk I am building, but the choice is yours – consult the help file WinPE.chm for a detailed description of what each package does, and decide which ones you want to leave in.
https://www-secure.symantec.com/connect/articles/readyadventures-winpe
dism.exe /image:c:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-scripting_en-us.cab"where E:\ is the root location of the SP1 supplement.
REM dism.exe /image:c:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-legacysetup.cab"
echo Updating path to include peimg, cdimage, imagex, dism
dism.exe /image:c:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-mdac.cab"
dism.exe /image:c:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-wmi.cab"
I have also added a colour version of winpe.bmp from a Vista install CD, as the default used is monochrome and looks somewhat boring.
C:
(WS.10).aspx )
WinPE 3.0 introduces the DISM.EXE tool (Deployment Image Servicing and Management) as the primary utility for creating the content for the iso and wim files.
** This mounts the “template image” so that you can add packages and other files. dism.exe /Unmount-Wim /MountDir:c:\winpe_x86\mount /discardThe contents of this folder will be copied into the WinPE image by my scripts, so place in that folder any programs you may wish to run under WinPE.
oscdimg -n -bc:\winpe_x86\etfsboot.com c:\winpe_x86\ISO c:\winpe_x86\Winpe_x86.iso
**This command copies the imagex.exe utility to the boot image. Imagex.exe can create images in much the same way as Ghost, and is useful to have available on any WinPE boot image. 5a. dism.exe /image:c:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-hta_en-us.cab"The next step is to create the file Unmount.bat with the following content:
dism.exe /image:c:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-hta.cab"dism.exe /Mount-Wim /WimFile:c:\winpe_x86\winpe.wim /index:1 /MountDir:c:\winpe_x86\mount
The end result of all this activity can be found in the folder C:\winpe_x86.
At this point, I will go into some detail as to what the script is doing as this will help users to recover from any errors and also to tailor the script to their specific needs.
Then just run the setup of the WAIK from the DVD (real or virtual), and let it install to the default location. (If you choose to install to another folder, you will have to make many edits to the scripts that follow.) The option to choose from the setup menu is the Windows AIK setup. The other install options are not required for this process.
REM dism.exe /image:c:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-setup.cab"
Edit line 65 of COPYPE.CMD from:
dism.exe /image:c:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-pppoe.cab"
dism.exe /Unmount-Wim /MountDir:c:\winpe_x86\mount /Commit
The objectives of this article are to show how to create a Windows PE 3 iso image, which can then be used to create a WinPE 3 bootable CD or DVD or used with VMWare as a bootable iso image. The associated boot.wim file can also be installed on USB flash memory devices and USB hard disks to create a portable bootable environment that can support all your computer hardware.
(At this time I want to point out that the steps I am recording here worked for me, but I offer no warranties that it will work for everyone, so don’t blame me if anything happens to your system. If in doubt, carry out the procedure in a Windows 7 virtual machine – either 32 bit or 64 bit.)
The reason I have made these changes is to avoid errors where the scripts don’t run because DISM.EXE cannot be found. A closer examination of the copype.cmd file reveals that the existing system path is appended to, but of course these changes only apply to the current command window so are transient in nature. Should you wish to be able to type DISM commands from any command window, then the path to DISM.EXE
In my folder, I have Ghost32.exe and GImageX.exe in my folder but there are many other useful tools that can be added depending on your individual requirements. Note that the copy operation does not copy subfolders, but if you need to, just use XCOPY instead in the script.
REM dism.exe /image:c:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-setup-client.cab"
(The detailed instructions for this supplement can be found here:
** Runs copype.cmd to generate an x86 environment in the folder c:\winpe_x86.
to:
dism.exe /image:c:\winpe_x86\mount /Get-PackagesCD "C:\Program Files\Windows AIK\Tools\x86\Servicing"
10. del /q c:\winpe_x86\iso\boot\bootfix.bin
If things go badly wrong later and you want to start again, run Unmount.bat then delete the c:\winpe_x86 folder
Xcopy c:\winpe_x86\iso\*.* /s /e /f F:\By all means add further pause commands if you want to check that each step completes without error. The batch script must be run “as administrator” using the right-click mouse option from explorer.
The USB device is now ready to be tested.
32 bit boot
copy "C:\Program Files\Windows AIK\WinPE3-Utils\*.*" "c:\winpe_x86\mount\Windows\System32"
Once the WAIK is installed, install the SP1 supplement from the second download. The installation of the supplement is achieved by mounting the ISO, opening an elevated command prompt and typing:
to:
?id=51888. dism.exe /Unmount-Wim /MountDir:c:\winpe_x86\mount /Commit
6. copy "C:\Program Files\Windows AIK\Tools\x86\imagex.exe" "c:\winpe_x86\mount\Windows\System32"
1. CD "C:\Program Files\Windows AIK\Tools\PETools"
At this point the USB device is ready to receive the Windows PE bootable file image. Verify the drive letter of the USB device, typically F:
xcopy E:\ "C:\Program Files\Windows AIK\Tools\PETools" /ERDY
2. call copype.cmd x86 c:\winpe_x86
To add some useful tools to your WinPE boot image, I now recommend creating a folder called: C:\Program Files\Windows AIK\WinPE3-Utils.
Creating a bootable USB device
Now we need to create the master script file Make-PE3.bat with the following content:
5. dism.exe /image:c:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-hta.cab"
was written for WinPE version 2, which is based on the Vista kernel.
pause(F: is the drive letter which directly references the USB device and should be amended if your USB device mounts on a different drive letter.)