Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Windows › Guide: How to make Windows reinstallations more efficeint with Windows PE
New Posts  All Forums:Forum Nav:

Guide: How to make Windows reinstallations more efficeint with Windows PE

post #1 of 45
Thread Starter 
Introduction:
WinPE, or Windows Preinstallation Environment is a compact “OS” that can be booted to for deployment of WIMs (Windows Images). WinPE was developed as a deployment method for images, mainly aimed at businesses or IT departments with a large number of computers to image. It is primarily used for Vista, but will also work for XP, if you do some research. I will however, only be covering the practical uses of WinPE for the deployment of Vista Images within your own home. If there is enough demand for it, I can append this guide to contain information on how to handle deployment in a network setting, or for multiple computers.

Uses:
One of the main uses of WinPE and WIMS is to create an image of your computer, that you can easily, and quickly restore to your machine. More or less, the idea is to make a clean install, and install all of the programs of yours that you know you will need, and capture the image. This way, if you format a lot, rather than completely reinstalling everything, all you will have to do is reapply the WIM, and you'll be good to go.

Now that I have those things out of the way, I will go into how to handle all of these things.

What you will need:
Windows AIK, found here
Blank CD

Step One: Installing Windows AIK
Install Windows AIK. You can either do this by burning the image to a disc, or mounting it with a virtualization program such as daemon tools.

If you plan to use Daemon tools, it can be found here. Download the file, and run the install. It will require a restart. Once restarted, you will have to continue the install, and eventually you will get choices of what to install. The following is what I choose:



Finish the install, and now you should see a small red icon in your system tray. Left click that icon, and you should see a no media option as shown here:



Select that, and navigate to where you downloaded the Windows AIK image. Open the image, and it will be mounted to the virtual drive. The setup should run automatically, but if it doesn't, simply navigate to My Computer, and open the new Virtual drive, and run the StartCD.exe found in there.

Once it runs, you should select the Windows AIK Setup option:



Continue through the install, as there are no special options that need to be selected.


Step 2: Building a WinPE boot disc
Now that we have Windows AIK installed, we need to build a WinPE boot disc.

First navigate to the WinPE Tools Command Prompt and run it as Administrator (found at Start->All Programs->Microsoft Windows AIK->Windows PE Tools Command Prompt)

With the command prompt open, type

Code:
copype x86 c:\\winpe_x86  (This is of course for 32bit.  If you need the AMD64 architecture, simply replace the 'x86' with 'amd64')

imagex /mountrw c:\\winpe_x86\\winpe.wim 1 c:\\winpe_x86\\mount 

xcopy “c:\\Program Files\\Windows AIK\\Toolsx86\\*.*” mount\\ /s
Use the following code to add imagex to the winpe disc. We will use imagex to capture and apply our images, so it's very important.

Code:
copy “c:\\program files\\Windows AIKTools\\x86\\imagex.exe” c:\\winpe_x86\\
Prepare the image to be used:

Code:
peimg /prep c:\\winpe_x86\\mount\\Windows
Type yes when prompted.

You should see a status bar run across, and when it is done, it will say “PEIMG completed the operation sucessfully”

Code:
imagex /unmount c:\\winpe_x86\\mount /commit
You should see “Successfully unmounted image” afterwards.

Code:
copy c:\\winpe_x86\\winpe.wim c:\\winpe_x86\\ISO\\sources\\boot.wim
Type yes when prompted.

Use the following code to build an iso from the files we've been working with:

Code:
oscdimg -n -bc:\\winpe_x86\\etfsboot.com c:\\winpe_x86\\ISO c:\\winpe_x86\\winpe_x86.iso

Now burn the Winpe_x86.iso found in the C:\\ drive directory to a CD. You now have a bootable WinPE disc, and we can get to work. I know this seems like a lot of work, but you only have to build the WinPE image and disc once. The rest is pretty quick and easy, and will save you all a lot of time when reinstalling windows.

Step 3: Using WinPE to capture your image


Of course, the first thing you want to do before capturing your image, is to make sure that you have your Windows install exactly as you want it, with all the necessary programs you will want to keep installed and configured.

The next step is to decide where you are going to store this image. You can set up a partition, solely for holding it, or you can of course, keep it on an external drive of some sort (what I do.) You only need to make sure that the external drive is large enough to hold everything you need. In general, most images I have dealt with, hang around the 10-12GB range depending on how much stuff you have installed, so make sure your drive is big enough to hold that.

Now that you have everything configured the way you want it, you now need to sysprep your machine. Sysprepping is necessary before an image capture, because if it isn't done, when you apply the image back to the computer, it will end up in a bootloop, an no one likes those.

To sysprep your machine, open a command prompt with administrative privileges, and run the following code:

Code:
C:\\windows\\system32\\sysprep\\sysprep.exe /generalize /oobe /shutdown
Your computer will shut down when it is done, and you are now ready to capture your image.

Boot to the WinPE disc we burnt earlier. It will take a little bit, and will look a lot like you're booting into Vista. You should see this when it's done booting:


(picture used from http://msmvps.com/blogs/erikr/Window...F6/image_2.png because I didn't take a ss while in WinPE.)

Wait until it prompts you to, and then navigate back to the X: directory.

Code:
cd ..
cd ..
It should only take twice to get back to X:. Once here, we can use imagex, which we added when building the image for WinPE. Imagex is what we will be using to capture and apply our images. The following code will capture the image:

Code:
imagex /compress fast /flags "Vista Version" /verify /capture c: e:\\myImages\\firstImage.wim “Name” "description"
Notice here that the first command is to run imagex, then the compression flag to save time, but the file will be slightly larger. If you want it as small as possible, simply leave the compress flag out. The verify flag follows (verifying contents are good to go,) then the capture flag, the drive we are capturing, and finally, the path to store the image.

Simply fill in Name and Description with what you want. The description is not required, but could prove useful if you ever decide to go further with WIMs and want to use them with a normal Vista setup. I can explain that method as well if it turns out people are interested.

Step 4: Using WinPE to Apply your image

Now that you have a nice WIM of your beginning install, you will probably want to apply it to your computer whenever you feel like formatting. This will save you time in the long run, as you can just apply this image every time, rather than formatting. Thus, saving time installing all your programs .

To apply the image, boot into WinPE just as before, and navigate back to the X: directory as we did with the cd commands before, and run the following code:
Code:
diskpart
select disk 0
clean
create partition primary size=xxxxx
select partition 1
active
format
exit
Replace the 'xxxxx' with the size of the partition you would like to create in MB.

That formats the hard drive and gets it ready for the application of our image. Now apply the image:
Code:
imagex /apply e:\\myImages\\firstImage.wim 1 c: /verify
Notice we called imagex just as before, but with the apply flag this time. The second part is the location of wherever you stored the wim, the number denotes the install from within the WIM (in this case it will always be 1, as I did not show you how to make multiple installs in a single WIM), and then the drive to apply the WIM to.

This will run through, and when you reboot, you will have the install that you know and love, with all of your programs, saving you time, and trouble.

In closing:

Most of this guide was built through personal experience, and research, as I had to develop a system for doing these things at work. It was while doing this that I realized how applicable it was to a personal computer, and I built this guide. You can find most of this information on the Microsoft website. I do not claim to have made up any of this information on my own. This is simply a lot of information put together into a single guide, for your help. If there are any questions, please feel free to ask. If you would like me to go into more detail in any part, I certainly can. Also, thanks to TnB=Gir for proofreading this for me .
Edited by BiG O - 7/10/08 at 12:47pm
post #2 of 45
great guide...im definitely going to have to do this next time i reformat
The Dark Knight
(15 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 G0 @ 3.2 EVGA 780i A1 HD 5850 4 x 2 gb gskill ddr2-1066 
Hard DriveHard DriveHard DriveOptical Drive
Sandisk SSD Raptor X WD Caviar ASUS 20x DVD-RW 
OSMonitorKeyboardPower
Win7 Pro 64bit Westinghouse 22" Logitec G11 Rosewill 950 watt 
CaseMouseMouse Pad
Antec 900 Logitec G9 Fundamentals of Analytical Chemistry Textbook 
  hide details  
Reply
The Dark Knight
(15 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 G0 @ 3.2 EVGA 780i A1 HD 5850 4 x 2 gb gskill ddr2-1066 
Hard DriveHard DriveHard DriveOptical Drive
Sandisk SSD Raptor X WD Caviar ASUS 20x DVD-RW 
OSMonitorKeyboardPower
Win7 Pro 64bit Westinghouse 22" Logitec G11 Rosewill 950 watt 
CaseMouseMouse Pad
Antec 900 Logitec G9 Fundamentals of Analytical Chemistry Textbook 
  hide details  
Reply
post #3 of 45
Thread Starter 
Quote:
Originally Posted by jhotmann21 View Post
great guide...im definitely going to have to do this next time i reformat
If you put in the time to do it up front, it saves a lot of time in the long run...especially if you reformat a lot.

EDIT: I am just now realizing that the code sections knocked out all of my \\'s so the code is incorrect. I'm trying to edit them back in, but it doesn't seem to want to take them. The ideas here are still the same, I'm just getting the commands fixed. I will hopefully have everything straightened out shortly. Just have to type '\\\\' everywhere there should be a \\...stupid me. I should have known that from programming .
Edited by BiG O - 7/9/08 at 2:43pm
post #4 of 45
WOW. I've never heard of this before but this is amazing. I've been getting some wierd windows issues lately and my restore points are all too new to fix anything I think a reformat is actually in my future. I'll definately check back to this when that time comes. +rep!
The Beast
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 @ 3ghz 24/7 XFX 750i XFX 8800gt Alpha Dog! 2gb OCZ SLI edition DDR2-800mhz 
Hard DriveOptical DriveOSMonitor
RAID 0 setup for OS and 750gb/500gb storage drives DVD/CD RW w/ lightscribe Windows 7 Ultimate x86 Westinghouse 22w2! 
KeyboardPowerCaseMouse
some wireless deal with media keys Ultra 650w Ultra Aluminus Full Tower a cheapy 
Mouse Pad
mah desk 
  hide details  
Reply
The Beast
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 @ 3ghz 24/7 XFX 750i XFX 8800gt Alpha Dog! 2gb OCZ SLI edition DDR2-800mhz 
Hard DriveOptical DriveOSMonitor
RAID 0 setup for OS and 750gb/500gb storage drives DVD/CD RW w/ lightscribe Windows 7 Ultimate x86 Westinghouse 22w2! 
KeyboardPowerCaseMouse
some wireless deal with media keys Ultra 650w Ultra Aluminus Full Tower a cheapy 
Mouse Pad
mah desk 
  hide details  
Reply
post #5 of 45
i do reformat quite a bit so this will cut out hours of driver downloading and windows updates
The Dark Knight
(15 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 G0 @ 3.2 EVGA 780i A1 HD 5850 4 x 2 gb gskill ddr2-1066 
Hard DriveHard DriveHard DriveOptical Drive
Sandisk SSD Raptor X WD Caviar ASUS 20x DVD-RW 
OSMonitorKeyboardPower
Win7 Pro 64bit Westinghouse 22" Logitec G11 Rosewill 950 watt 
CaseMouseMouse Pad
Antec 900 Logitec G9 Fundamentals of Analytical Chemistry Textbook 
  hide details  
Reply
The Dark Knight
(15 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 G0 @ 3.2 EVGA 780i A1 HD 5850 4 x 2 gb gskill ddr2-1066 
Hard DriveHard DriveHard DriveOptical Drive
Sandisk SSD Raptor X WD Caviar ASUS 20x DVD-RW 
OSMonitorKeyboardPower
Win7 Pro 64bit Westinghouse 22" Logitec G11 Rosewill 950 watt 
CaseMouseMouse Pad
Antec 900 Logitec G9 Fundamentals of Analytical Chemistry Textbook 
  hide details  
Reply
post #6 of 45
Thread Starter 
Quote:
Originally Posted by jhotmann21 View Post
i do reformat quite a bit so this will cut out hours of driver downloading and windows updates
That's exactly the reason i started doing this. I reformat all the time. The worst part is the hour or two just getting everything set back up the way you want to.
post #7 of 45
that's pretty cool, that file is freaking huge though. Looks like you build an image of what's installed on your computer already. I'm going to have to check this out. I'm wondering since I use VLITE to reinstall Vista every few months if I can do them together.

It looks like if I do a fresh install using my vlite disc and then updating everything then I make an image with this program? That way everything willl then be sliptreamed with all updates and a smaller image.

I'll have to check it out since I'm on vacation all next week. Looks like i'll be playing 18 holes of golf everyday and working on my computer the rest of the time.

rep+1
post #8 of 45
Awesome post, rep+.
My System
(16 items)
 
  
CPUMotherboardGraphicsRAM
6850K ASUS X99-AII eVGA GTX 1060 32Gb Team Vulcan DDR4 3000 Cas 15 
Hard DriveHard DriveHard DriveHard Drive
Samsung 960 EVO NVME Crucial M500 Seagate HDD Samsung F3 
CoolingOSMonitorKeyboard
H100i Windows 10 Pro 64 Samsung KU6300 40" Corsair K70 Vengeance 
PowerCaseMouse
Seasonic Gold 750W Phantek Enthoo Pro M Logitech G9X 
  hide details  
Reply
My System
(16 items)
 
  
CPUMotherboardGraphicsRAM
6850K ASUS X99-AII eVGA GTX 1060 32Gb Team Vulcan DDR4 3000 Cas 15 
Hard DriveHard DriveHard DriveHard Drive
Samsung 960 EVO NVME Crucial M500 Seagate HDD Samsung F3 
CoolingOSMonitorKeyboard
H100i Windows 10 Pro 64 Samsung KU6300 40" Corsair K70 Vengeance 
PowerCaseMouse
Seasonic Gold 750W Phantek Enthoo Pro M Logitech G9X 
  hide details  
Reply
post #9 of 45
Thread Starter 
Quote:
Originally Posted by GoOffroad View Post
that's pretty cool, that file is freaking huge though. Looks like you build an image of what's installed on your computer already. I'm going to have to check this out. I'm wondering since I use VLITE to reinstall Vista every few months if I can do them together.

It looks like if I do a fresh install using my vlite disc and then updating everything then I make an image with this program? That way everything willl then be sliptreamed with all updates and a smaller image.

I'll have to check it out since I'm on vacation all next week. Looks like i'll be playing 18 holes of golf everyday and working on my computer the rest of the time.

rep+1
The file is huge because it's a normal vista install PLUS everything you have installed. I overquoted the size of the images because I don't want you running out of space .
post #10 of 45
320gb single platter western digital main drive and 640gb wd backup. i'm good
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Windows
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Windows › Guide: How to make Windows reinstallations more efficeint with Windows PE