Posted 4/26/13 • Last updated 2/12/14 • 9,077 views
To begin with, you need downloaded and installed: Windows ADK.WinPE4 & DISM make this sooo much easier now, and support such a large variety of machines out of the box that it made me less Raging for the first time in a very long time. No need for 3rd party tools or guides (unless you get extremely fancy), straight from Microsoft (all of this material is straight from MS infact.)
Guide to WinPE USB Creation:
http://technet.microsoft.com/en-us/library/hh825109.aspx
Once ADK is also installed, you will want those deployment tools from its folder on the External.
They are found here:
Code:
C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools
Copy the Deployment Tools folder to your external drive and name it something you will remember, since this is the core of WADK tools,
I named my copied folder WADK.
Recommended Tools Before Beginning:
- An OS that has already been Sysprepped/Unattend prepared!
- 2~4GB Flash Drive (Since it is usually fat32, you don’t want to store your 4GB+ file sized image here so just use it for booting PE4.)
- External Drive (or another Internal Drive for storing the image to be ripped.)
Boot to the USB WinPE4.0 after your OS has been sysprepped. If you have successfully created a bootable flash drive via the first guide, you should be sitting at a pretty CMD in fast and sexy WinPE4.0.
This should be the default directory you are looking at after it is finished loading:
Code:
X:\Windows\System32
From here, we need to see what WinPE has done about labeling your drives and partitions.
Code:
diskpart
select disk 0
list partition
select partition 0 //only if you use a system partition
assign letter="S" //S for System
select partition 1 //again, would be 0 if there is no partition ahead of this
assign letter="W" //W for Windows
list volume // Look for you external HDD and remember the Drive letter assigned or change it yourself
exit
Now that we have labeled your drives something recognizeable, we then navigate to the WADK folder on your external drive, using the drive letter you just looked up. Mine was assigned to L.
Change root:
Navigate to DISM folder inside of the WADK copy you made:
Code:
L:\WADK\AMD64\DISM\
Capturing the Image!
Since your OS is already sysprepped and ready to go, you simply capture the correct partition / drive mount
Code:
Dism /Capture-Image /ImageFile:L:\WinImg.wim /CaptureDir:W:\ /Name:"Windows"
Alternatively using UNC and Domain:
Code:
net use Z: \\ServerName\SharedFolder /user:domain\user PASSWORD
Dism /Capture-Image /ImageFile:Z:\MyImages\WinImg.wim /CaptureDir:W:\ /Name:"Windows"
Applying a Captured Image:
Disk Preperation:
Code:
diskpart
select disk 0
clean
create partition primary size=100
format quick fs=ntfs label="System"
assign letter="S"
active
create partition primary
format quick fs=ntfs label="Windows"
assign letter="W"
exit
S:\ Is the 100mb system partition which stores boot info.
W:\ Is the Windows partition.
Whatever drive the Ext HDD is (L:\ for example), navigate to the DIdism SM folder.
Code:
L:
cd L:\WADK\AMD64\DISM
(If you need to find out what drive letter the external hard drive is use DISKPART followed by the “List Volume” command, the “L:” is just the standard way of changing the root drive letter you are working for. You don’t CD L: or CD Q: to change drives, you simply type the drive letter with a colon.)
Apply Windows Image:
Code:
dism /apply-image /imagefile:L:\WinImg.wim /index:1 /ApplyDir:W:\
L:\Directory to Image\ImageFile.WIM, the above Images were just stored on the root of the drive.
Upon fully imaging the drive, you want to create correct boot drive options:
Return to RAM DISK X:\ by typing:
Should return you to X:\Windows\System32. If not navigate there with CD. Then run BCDBOOT as such:
Code:
bcdboot W:\Windows /l en-US
It will automatically apply to S:\ because of the label. (If it fails for whatever reason you may force application to S drive by using /S S: )
After this it should be good to go and boot the OS.
Sources of Information & Other seriously useful DISM links:
Capturing images with DISM:
http://technet.microsoft.com/en-us/library/hh825072.aspx
Applying images with DISM:
http://technet.microsoft.com/en-us/library/hh824910.aspx
BCBOOT Command Line Options:
http://technet.microsoft.com/en-us/library/hh824874.aspx
Mounting an image and editing files inside it:
http://msdn.microsoft.com/en-us/library/ff794887(v=winembedded.60).aspx
Code:
Note all of this use to be done with a combination of DISM before and ImageX. ImageX is officially deprecated and DISM now retains all functionality and more.