Tips and Tricks for working with Windows PE 2.1

Wednesday, April 30, 2008

Mouse Wheel Support

Lack of mouse wheel support in Windows PE is one of those things that can be annoying. Especially when you are attempting to navigate quickly around the machine and not waste time. It is actually surprising to me that it is not enabled by default in PE. This is something that can be enabled by a simple registry key addition.

[HKEY_LOCAL_MACHINE\EXTERNALSYSTEM\ControlSet001\Services\i8042prt\Parameters] "EnableWheelDetection"=dword:00000002

Tuesday, April 15, 2008

Ram Drive Compression

One of the lesser known features of the Ram drive is the ability to add compression. This can help when there is a need to have a larger amount of data on the Ram drive without modifying the wim for the specific situation. It also helps for machines with minimal ram to keep the resource usage to a minimum.

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\FBWF] "CacheType"=dword:00000002
1 = Dynamic 2 = Dynamic Compressed 3 = Pre-Allocated I have tested each of the settings and Dynamic Compressed has worked the best for average usage. At this time I am not aware of another way to modify this cache type other than a registry key change. As far as performance goes I have not noticed any degradation of performance with the compression due to it being in physical ram.

Sunday, April 13, 2008

Windows PE Read AND Write the Registry?

I have many different variants of WinPE with varying installation mediums. One of my most recent versions is a Windows PE 2.0 installed to a hard drive. There are many benefits to this, the first of which is how fast it boots. With this particular machine it boots on average in about 3-5 seconds. Yes that's seconds. One of the many problems with PE is that the registry can be written to when it is booted but then when the system reboots it discards all of the changes made to it. With the primary purpose of PE this is not an issue however for those of us looking to expand PE's capabilities and searching for a version of Vista that is actually fast this can be an obstacle to bypass. With Vistas new form of boot.ini called the BCD many of the primary boot options are set with basic command line switches. One of the entries in the BCD is simply called "winpe". This is the switch from previous versions called "MININT". What this switch does when it is enabled is cause the configuration manager to load the registry hives as volatile so that any changes made to it are not saved to the original hives. The command as executed for the BCD would look like this: C:\bcdedit /set {7619dcc8-fafe-11d9-b411-000476eba25f} winpe No The primary issue with this is that once the registry is writeable the boot process changes. The system will no longer simply boot as previously. Once winpeshl.exe is executed it attempts to operate as previously with read only hives. A quick easy way to bypass this problem is simply replaces winpeshl.exe with a shell of your choice. To do this quickly you can simply rename your shell executable to "winpeshl.exe" and then it will be launched. I will continue to post about this in the future as I continue to explore down this path with the hard drive installation of WinPE.

Thursday, April 10, 2008

ImageX GUI

For those that do not want to do everything by command line there are a few other options. One of these options is the ImageX GUI made by Jonathan Bennett of AutoIt fame. Its fairly simple to use and just needs to be added to the imageX directory. Personally I find myself using it when I am just looking for some quick information about a particular wim without having to manually use the command prompt to get the information I need.

Wednesday, April 9, 2008

Download Windows AIK (WinPE)

For those that would like to start working with Windows PE you can start by downloading the Microsoft Windows AIK (Automated Installation Kit). Download Windows AIK Everything you will do be doing with it will be almost entirely by command line. It is designed to script Windows installations however for the purpose of WinPE it is necessary to do most tasks via command line.

Tuesday, April 8, 2008

Scratch Space aka Ram Drive

One of the many benefits of WinPE 2 is the Ram Drive. This allows you to install applications as well as have more room for the installed applications to work with. This is generally called the Ram Drive by most people and Microsoft calls it the Scratch Space. There are many ways to create or modify the amount of Scratch Space the most common of which is the following registry key.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\FBWF] "WinPECacheThreshold"=dword:00000020

;dword:00000010 = 16 ; 0x10 = 16Mb ; 0x18 = 24Mb ; 0x20 = 32Mb ; 0x30 = 48Mb ; 0x40 = 64Mb ; 0x48 = 72Mb ; 0x60 = 96Mb ; 0x80 = 128Mb ; 0x100 = 256Mb

By looking at the values you can see that there are a few different sizes to choose from. The default value for WinPE is 32 MB which you can see equates to a value of "0x20" for this key. There is another less known way to implement this tweak and I feel for most beginners it is also the best route. For this we are going to assume you are using the default PE locations and settings. The default location for the WinPE working directory is "C:\winpe_x86". Personally I suggest you move this a directory deeper to be something along the lines of "C:\PE\winpe_x86" however this is up to personal prefrence. We will use the default for most examples here to help keep everything syncronized with Microsofts documentation. The reasoning for moving it a directory deeper is to have your miscellaneus files in the "C:\PE" directory along with your winpe_x86 directory.
Step 1: Mount your boot.wim to C:\winpe_x86 Step 2: Open a command prompt then navigate to the following directory... C:\Program Files\Windows AIK\Tools\PETools\ Step 3: Type the following command: peimg.exe /scratchspace=256 /image=C:\winpe_x86\mount\Windows
For the /scratchspace command you can specify the values of 32, 64, 128, 256, 512. Something thats intresting to note with using this method is that the smallest you can create is 32 MB. With the above registry tweak you can create an even smaller Scratch Space of 16 MB as well as many other more defined sizes.

Welcome to All About WinPE 2

This website will be a general information website about Windows PE 2. For those that dont know what Windows Pre-installation Environment is, basically it is a minimal Windows based operating system that can be booted off of a CD-Rom. WinPE is becomming increasingly popular with the technical community due to it's usefulness. I have been working with WinPE for about 5 years since its inception with Windows XP. Here are a few more links regarding WinPE: