• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

recover windows 8 from a .wim file


jimbo45

New Member
VIP Member
Guru
Hafnarfjörður IS

Posts
4,373
#2
Hi there

1) Download the WAIK (W7 version is fine)

2) copy file IMAGEX.EXE from the WAIK to a directory -- use the correct IMAGEX file for the Windows you want to restore -- it sits in the TOOLS directory of the WAIK.

(AMD64 for W8 x-64, or the version in x-86 for 32 bit version. Don't use the one in the IA directory).

3) then simply run the command :

imagex.exe /apply install.wim 1 d:\ (d is the assumed drive you are using for your target system and the .WIM is the name of your .WIM file --I've just taken as an example the standard "INSTALL.WIM' file that exists on the install media for W8 Consumer Preview).

Note this must be a device (can be a USB etc) which already has an ACTIVE partition on it.

You'll also need to create the Boot image

after the WIM has restored run

bcdboot.exe d:\windows /s d: /f ALL (assumed d is the device where you have restored the WIM image via imagex).

You will actually need a W8 system to create the boot record --the W7 version of this program has slightly different parameters

So the easiest way if you don't have a W8 system is just quickly install a "Mickey Mouse" one -- takes about 10 mins - 15 mins -- doon't bother with finding drivers etc -- all you want it for is to run the bcdboot command and then you can get rid of it.

You could even use a VM.

Next time I'd suggest after the system is up and running is to save the image with something like Acronis / Macrium as you can even "Stand alone" restore these from DVD's etc.

Cheers
jimbo
 

My Computer

System One

  • OS
    Linux Centos 7, W8.1, W7, W2K3 Server W10
    Computer type
    PC/Desktop
    Monitor(s) Displays
    1 X LG 40 inch TV
    Hard Drives
    SSD's * 3 (Samsung 840 series) 250 GB
    2 X 3 TB sata
    5 X 1 TB sata
    Internet Speed
    0.12 GB/s (120Mb/s)

SIW2

Well-Known Member
Team Member
Posts
5,360
#3
Easier to d/l gimagex - it's very small and free - ( you will need to run it from win 7 or win8 or win7 or win 8 pe - else you will need to install wimfltr )

GImageX - AutoItScript

apply the image to a premade partition with that.

Create boot files with bcdboot command - use win8 you just applied as the source and the active partition as target.

bcdboot win8partitionletter:\windows /s activepartitionletter:

Win8 seems to be very fussy about where you are installing to - might not be happy if you are using one of those 100mb things as the active partition.

I ended up making the win8 partition iself the active one - it wouldn't co-operate otherwise.

Might be different on your system.
 

My Computer

System One

  • OS
    7/8/ubuntu/Linux Deepin
    Computer type
    PC/Desktop

jimbo45

New Member
VIP Member
Guru
Hafnarfjörður IS

Posts
4,373
#4
Easier to d/l gimagex - it's very small and free - ( you will need to run it from win 7 or win8 or win7 or win 8 pe - else you will need to install wimfltr )

GImageX - AutoItScript

apply the image to a premade partition with that.

Create boot files with bcdboot command - aimed at the active partition.
Hi there

I'd forgotten that program looks good --thanks

However you still need the bcdboot program from a W8 system -- I tried with a W7 system -- parameters all different. It *might* work* but as I had some W8 VM's it was easier to "attach" the device to the VM and use the BCDBOOT from that system.

You'll still need to download the WAIK too of course to get the imagex program. (I know this sounds obvious to experienced people but sometimes if you aren't usually involved in system deploymenet etc all this stuff is NEW so you might not realize that the GUI is only a "Front end" for the imagex program which you still have to get from Ms via the WAIK.

Cheers
jimbo
 

My Computer

System One

  • OS
    Linux Centos 7, W8.1, W7, W2K3 Server W10
    Computer type
    PC/Desktop
    Monitor(s) Displays
    1 X LG 40 inch TV
    Hard Drives
    SSD's * 3 (Samsung 840 series) 250 GB
    2 X 3 TB sata
    5 X 1 TB sata
    Internet Speed
    0.12 GB/s (120Mb/s)

SIW2

Well-Known Member
Team Member
Posts
5,360
#5
If you like, you can lean over and use the bcdboot.exe on the partition you just applied it to, like this:

win8partitionletter:\windows\system32\bcdboot win8partitionletter:\windows /s activepartitionletter:

So , in my case - where I had applied win8 to D and made D active

D:\windows\system32\bcdboot D:\windows /s D:
 

My Computer

System One

  • OS
    7/8/ubuntu/Linux Deepin
    Computer type
    PC/Desktop

jimbo45

New Member
VIP Member
Guru
Hafnarfjörður IS

Posts
4,373
#6
Yes, you can lean over and use the bcdboot.exe on the partition you just applied it to, like this:

win8partitionletter:\windows\system32\bcdboot win8partitionletter:\windows /s activepartitionletter:
Hi there SIW2 -- thanks for the tip -- I went the VM route but this is obviously easier and quicker -- you've obviously done this stuff before !!!!.

I created a single partition with Diskpart Clean etc. so no probs with the "System Partition" that is sometimes created with W7 / W8 installs.

I think if the WHOLE device is used as a single partition it's fine. You can "shink" the partition afterwards wit GPARTED / PartitionImage etc.

Cheers
jimbo
 

My Computer

System One

  • OS
    Linux Centos 7, W8.1, W7, W2K3 Server W10
    Computer type
    PC/Desktop
    Monitor(s) Displays
    1 X LG 40 inch TV
    Hard Drives
    SSD's * 3 (Samsung 840 series) 250 GB
    2 X 3 TB sata
    5 X 1 TB sata
    Internet Speed
    0.12 GB/s (120Mb/s)

SIW2

Well-Known Member
Team Member
Posts
5,360
#7
I always install like that.

It allows for a bit of registry customizing after applying and before rebooting.

Had a bit of trouble with 8 - not sure why yet.
 

My Computer

System One

  • OS
    7/8/ubuntu/Linux Deepin
    Computer type
    PC/Desktop

fafhrd

Active Member
Pro User
Portsmouth Hants

Posts
772
#8
I found that just applying the W8CP install.wim to a partition that previously had contained a windows 7 installation which had just been quickformatted over, needed no additional work to get to boot - the Windows 7 bootloader seemed to be happy to load the old bcd data and boot the Windows 8 system up. F8 worked fine from the bootmenu too. I just needed to edit the boot entry to read "Windows 8 x64".

As an alternative to Imagex, there's a free to home users program called SmartWIM, which has the additional feature of being able to create diff files - making the images much more flexible as backups. It's also scriptable, and also a very small download.

SmartWIM 2.0 now available - DeployCentral
SmartDeploy OS Deployment Products
 

My Computer

System One

  • OS
    Windows 8.1 Pro with Media Center
    Computer type
    PC/Desktop
    System Manufacturer/Model Number
    HP COMPAQ Presario CQ57
    CPU
    AMD E- 300 APU with Radion HD Graphics 1.30GHz
    Motherboard
    inbuilt
    Memory
    4GB
    Graphics Card(s)
    ATI
    Sound Card
    High Definition Audio on-board
    Monitor(s) Displays
    notebook
    Screen Resolution
    1366x768
    Hard Drives
    Seagate ST9500325AS
    Google drive 15GB
    Skydrive 25GB
    BT Cloud
    PSU
    external 20v
    Case
    Laptop
    Cooling
    pretty good
    Keyboard
    inbuilt
    Mouse
    touchpad
    Internet Speed
    BT Infinity Unlimited - 80 up 20 down =70/16 really
    Browser
    Chrome Canary usually
    Antivirus
    Windows Defender and Malwarebytes
    Other Info
    no Start menu modifications
    Upgraded with no issues to 8.0 and to 8.1

jimbo45

New Member
VIP Member
Guru
Hafnarfjörður IS

Posts
4,373
#10
Don't use WAIK anymore with CP. About the Windows Assessment and Deployment Kit <-- this is it's replacement.

Hi there
????

What are you actually saying here --I can't find ANYTHING in your post --including going to the MS link which serves as the replacement .

Also SmartWim runs like a One Legged dog on an Ice Pond compared with IMAGEX. I'm always suspicious anyway of these type of products. If MS is designing windows it just seems obvious that for "Kernel" type images MS should be the best source --note here I'm not talking about 3rd party apps etc but just the basic kernel Sources.

Cheers
jimbo
 

My Computer

System One

  • OS
    Linux Centos 7, W8.1, W7, W2K3 Server W10
    Computer type
    PC/Desktop
    Monitor(s) Displays
    1 X LG 40 inch TV
    Hard Drives
    SSD's * 3 (Samsung 840 series) 250 GB
    2 X 3 TB sata
    5 X 1 TB sata
    Internet Speed
    0.12 GB/s (120Mb/s)
Posts
1,851
#11
The 100 MB Win7 system partition sounds like a likely candidate for having thrown troubles with the imagex method. The laptop I applied it on when I made the new partition for Win8 did not have the 100 MB reserved at all.
 

My Computer

System One

  • OS
    8250 x86 + 7 SP1 x86 + Ubuntu 12.04 LTS x86
    CPU
    P4 3.4 GHz HT
    Motherboard
    MSI-7211
    Memory
    OCZ 2 GB DDR @ 400 MHz
    Graphics Card(s)
    HIS AGP HD 3850 Turbo Ice-Q
    Sound Card
    MOTU Traveler firewire interface
    Monitor(s) Displays
    Acer x223w
    Screen Resolution
    1680x1050
    Hard Drives
    WD Caviar Black 1 TB Sata II, WD 400 GB Sata I, WD 120 GB Sata I
    PSU
    300W generic
    Case
    Cybertron
    Keyboard
    Logitech Classic Keyboard 200, Dell RT7D20
    Mouse
    Logitech M510
    Internet Speed
    2 MByte/sec Down, 250 KByte/sec Up

baarod

Windows 8 Convert
VIP Member
Member
Odell

Posts
60
#13
Don't use WAIK anymore with CP. About the Windows Assessment and Deployment Kit <-- this is it's replacement.

Hi there
????

What are you actually saying here --I can't find ANYTHING in your post --including going to the MS link which serves as the replacement .

Also SmartWim runs like a One Legged dog on an Ice Pond compared with IMAGEX. I'm always suspicious anyway of these type of products. If MS is designing windows it just seems obvious that for "Kernel" type images MS should be the best source --note here I'm not talking about 3rd party apps etc but just the basic kernel Sources.

Cheers
jimbo
There is no WAIK for Windows 8. There is not now and will never be one. WAIK has been supplanted by WADK or Windows Assessment and Deployment Kit. From the website I linked:

"Windows deployment is intended for OEMs and IT professionals who want to customize and automate the installation of Windows in their factories or organizations. In addition to new tools, the Windows ADK includes the deployment tools that were previously released as part of the Windows OEM Preinstallation Kit and the Windows Automated Installation Kit."

It's got the new version of bcdboot, bcdedit, bootsect and imagex as well as the very different Windows Pre-installation images and tools. Plus it's more download friendly. You download a stub installer that only grabs the stuff you are interested in.
 

My Computer

System One

  • OS
    Windows 8CP

floepie

New Member
Member
Posts
42
#16
win8partitionletter:\windows\system32\bcdboot win8partitionletter:\windows /s activepartitionletter:
In order to restore an OEM's recovery from a hidden partition on a W8 system, can one simply use the cmd prompt to issue this command after booting from a W8-generated USB recovery drive, assuming that I have the contents of the recovery partition copied to the recovery drive? Is the bcdboot and cmd prompt available from the recovery drive? And, in what instance would you need to assign different letters to Win8 and the active partition?

There are also WIMs for the EFI (boot) and Reserve partitions as well I believe (at least the EFI partition). Do these need to be "applied" as well in order to for it to boot, or are the commands sufficient in that they would write to the boot partition (EFI) all that is needed? And, what drive letter would I use in a recovery environment for an EFI partition if I were to restore the WIM?

I plan to first "clean install" with my own W8 version over the OEM system, but I just want to be sure I can recover back to the OEM version if need be. Hopefully, this "clean install" will simply overwrite (not resize or delete) the OEM EFI (boot) and reserve partitions.

FWIW, I have partitions in the following order on the GTP disk:
1. Recovery (WinRE) - 1000 MB
2. EFI boot - 260 MB
3. OEM Partition (nothing here) - 1000 MB
4. Reserve - 128 MB
5. System
6. Recovery Partition - 14000 MB
7. IRST (Intel Rapid Start) - 8000 MB

I plan to first clean install over the existing system, but I just want to be sure I can recover back to OEM if need be.
 
Last edited:

My Computer

System One

  • OS
    Windows 8.1 Core
    Computer type
    Laptop
    System Manufacturer/Model Number
    Asus UX302LA

baarod

Windows 8 Convert
VIP Member
Member
Odell

Posts
60
#17
In order to restore an OEM's recovery from a hidden partition on a W8 system, can one simply use the cmd prompt to issue this command after booting from a W8-generated USB recovery drive, assuming that I have the contents of the recovery partition copied to the recovery drive? Is the bcdboot and cmd prompt available from the recovery drive? And, in what instance would you need to assign different letters to Win8 and the active partition?
<snip>
So far we have not covered GPT UEFI booting. I've tried several times to create a UEFI boot UFD containing Win8 PE from the ADK, the DISM dir (recommended over IMAGEX now), BCDBOOT and the INSTALL.WIM from the Win8 x64 ISO sources directory. They idea is to set the destination computer to boot insecure UEFI from the UFD, DISKPART sel dis, cle, con gpt, cre par xyz, for quick, ass, exi and DISM /apply-image to the boot partition. The problems lies with getting a compatible system partition load with BCDBOOT for the system partition. I'm using the info here as the basis of my research: Sample: Configure UEFI/GPT-Based Hard Drive Partitions by Using Windows PE and DiskPart

I think what you are asking is how to go about doing a recovery -- that involves both the Windows Recovery Environment (WinRE) AND your custom recovery partition. More info here: Samples: Applying Windows, System, and Recovery Partitions by using a Deployment Script
 

My Computer

System One

  • OS
    Windows 8CP

Haxcid

Member
Member
Camarillo, Ca.

Posts
59
#18
Don't use WAIK anymore with CP. About the Windows Assessment and Deployment Kit <-- this is it's replacement.

Hi there
????

What are you actually saying here --I can't find ANYTHING in your post --including going to the MS link which serves as the replacement .

Also SmartWim runs like a One Legged dog on an Ice Pond compared with IMAGEX. I'm always suspicious anyway of these type of products. If MS is designing windows it just seems obvious that for "Kernel" type images MS should be the best source --note here I'm not talking about 3rd party apps etc but just the basic kernel Sources.

Cheers
jimbo
There is no WAIK for Windows 8. There is not now and will never be one. WAIK has been supplanted by WADK or Windows Assessment and Deployment Kit. From the website I linked:

"Windows deployment is intended for OEMs and IT professionals who want to customize and automate the installation of Windows in their factories or organizations. In addition to new tools, the Windows ADK includes the deployment tools that were previously released as part of the Windows OEM Preinstallation Kit and the Windows Automated Installation Kit."

It's got the new version of bcdboot, bcdedit, bootsect and imagex as well as the very different Windows Pre-installation images and tools. Plus it's more download friendly. You download a stub installer that only grabs the stuff you are interested in.
You are splitting hairs. WAIK, WADK, same thing different version.

Now for the wim... You created a wim...

1. Name it install.wim
2. Place it on an external HDD, in a directory called Win8
3. Get the Win8 boot DVD, copy all files off it to the Win8 folder on the external.
4. Now you can plug it into the system, boot from the dvd OR a WinPE4 disk, get to the command prompt, then change directories to the external and the win8 dir.
type in setup... It should launch the Win 8 setup from the drive, and use your wim file for the install, which means all the software, and data should still be there...

This way if you are not an IT professional than you do not have to learn WADK and DISM which are both a pain...
 

My Computer

System One

  • OS
    All Versions Of Windows
    Computer type
    PC/Desktop
    System Manufacturer/Model Number
    Home Built
    CPU
    Intel I5-2500K
    Motherboard
    ASUS Maximus IV GENV
    Memory
    DD3 1600 Crucial 8G 2x4
    Graphics Card(s)
    NVidia ONY XLR8 gtx460oc
    Sound Card
    onboard xFI
    Monitor(s) Displays
    Samsung 24" LCD
    Screen Resolution
    1920x1080
    Hard Drives
    2x160 SATA 2 WD
    1x250 Samsung SATA 2
    PSU
    Cooler Master 650w
    Case
    Antec 300
    Cooling
    Cooler Master 212 Pus
    Keyboard
    iRocks Gaming Keyboard
    Mouse
    Logitech G400
    Internet Speed
    25Mb Down 2Mbit Up

floepie

New Member
Member
Posts
42
#19
So far we have not covered GPT UEFI booting. I've tried several times to create a UEFI boot UFD containing Win8 PE from the ADK, the DISM dir (recommended over IMAGEX now), BCDBOOT and the INSTALL.WIM from the Win8 x64 ISO sources directory. They idea is to set the destination computer to boot insecure UEFI from the UFD, DISKPART sel dis, cle, con gpt, cre par xyz, for quick, ass, exi and DISM /apply-image to the boot partition. The problems lies with getting a compatible system partition load with BCDBOOT for the system partition. I'm using the info here as the basis of my research: Sample: Configure UEFI/GPT-Based Hard Drive Partitions by Using Windows PE and DiskPart

I think what you are asking is how to go about doing a recovery -- that involves both the Windows Recovery Environment (WinRE) AND your custom recovery partition. More info here: Samples: Applying Windows, System, and Recovery Partitions by using a Deployment Script
Interesting. With those two links and the OEM WIM file, it seems you can restore it to bare metal quite easily from a WinPE disk. Now, the OEM recovery partition also contains WIMs for the EFI and WinRE as well, but it appears the script handles this by simply copying contents from the applied WIM to those partitions. From experience of which I have absolutely none, are these "helper" WIMs required to apply in place of the default ones applied in the script?

The second method from Haxcid above seems even easier in that you can simply replace the install.wim on a normal W8 install DVD with an OEM's install.wim? Almost sounds too good to be true!
 

My Computer

System One

  • OS
    Windows 8.1 Core
    Computer type
    Laptop
    System Manufacturer/Model Number
    Asus UX302LA

Haxcid

Member
Member
Camarillo, Ca.

Posts
59
#20
So far we have not covered GPT UEFI booting. I've tried several times to create a UEFI boot UFD containing Win8 PE from the ADK, the DISM dir (recommended over IMAGEX now), BCDBOOT and the INSTALL.WIM from the Win8 x64 ISO sources directory. They idea is to set the destination computer to boot insecure UEFI from the UFD, DISKPART sel dis, cle, con gpt, cre par xyz, for quick, ass, exi and DISM /apply-image to the boot partition. The problems lies with getting a compatible system partition load with BCDBOOT for the system partition. I'm using the info here as the basis of my research: Sample: Configure UEFI/GPT-Based Hard Drive Partitions by Using Windows PE and DiskPart

I think what you are asking is how to go about doing a recovery -- that involves both the Windows Recovery Environment (WinRE) AND your custom recovery partition. More info here: Samples: Applying Windows, System, and Recovery Partitions by using a Deployment Script
Interesting. With those two links and the OEM WIM file, it seems you can restore it to bare metal quite easily from a WinPE disk. Now, the OEM recovery partition also contains WIMs for the EFI and WinRE as well, but it appears the script handles this by simply copying contents from the applied WIM to those partitions. From experience of which I have absolutely none, are these "helper" WIMs required to apply in place of the default ones applied in the script?

The second method from Haxcid above seems even easier in that you can simply replace the install.wim on a normal W8 install DVD with an OEM's install.wim? Almost sounds too good to be true!
I used to do it with windows 7 all the time. It allowed me to carry a complete windows install on a flash drive. I could walk up to a machine, insert the usb flash drive, boot from it and install complete working windows with software like Office 2010, flash, reader, quicktime, java, etc... Took about 20 minutes. I would have updated the systems than captured the wim using imagex. Works great for clean installing stand alone machines. I think they have a tutorial for it here for W7. Pretty much the same thing. Ours was slightly more complex as we sysprepped the image so it works on any hardware.

I don't see why it would not work. I have a network cut over next week. Rewired 2 of our sites and we are swapping everything over to the new cabling and switches but the week after that I think I will give it a go.
 

My Computer

System One

  • OS
    All Versions Of Windows
    Computer type
    PC/Desktop
    System Manufacturer/Model Number
    Home Built
    CPU
    Intel I5-2500K
    Motherboard
    ASUS Maximus IV GENV
    Memory
    DD3 1600 Crucial 8G 2x4
    Graphics Card(s)
    NVidia ONY XLR8 gtx460oc
    Sound Card
    onboard xFI
    Monitor(s) Displays
    Samsung 24" LCD
    Screen Resolution
    1920x1080
    Hard Drives
    2x160 SATA 2 WD
    1x250 Samsung SATA 2
    PSU
    Cooler Master 650w
    Case
    Antec 300
    Cooling
    Cooler Master 212 Pus
    Keyboard
    iRocks Gaming Keyboard
    Mouse
    Logitech G400
    Internet Speed
    25Mb Down 2Mbit Up