Best way to restore a Win ISO to an external drive/partition, while in Windows?

XYZ

Member
Suppose you only have one computer, but multiple external disk's. What would be the best/easiest way to install a newly NTLite'd Win ISO to a separate drive/disk, without rebooting the one computer (ie. while the one computer is running) ?
 
Technically you could, but it requires a high level of Windows expertise. What functions does the WinPE Setup perform?

1. Boots and recognizes HW devices
2. Formats & preps the individual partitions (EFI, MSR, Windows, Recovery)
3. Extracts the install.wim to the Windows volume
4. Updates bcdstore with the new boot option
5. Reboots into the extracted Windows image, to continue installation

Let's consider the deployment steps:

1. You already know the target PC's driver set, so they can be integrated in install.wim. There's no need for a boot.wim, since we're installing from a live host.

2. Run diskpart with a command file, which wipes the disk and creates the normal partitions.

diskpart /s commands.txt
Code:
select disk 6
clean
convert gpt
create partition efi size=100
format quick fs=fat32
assign letter=S
create partition msr size=16
create partition primary
shrink minimum=700
format quick fs=ntfs
assign letter=W
create partition primary
format quick fs=ntfs
assign letter=R
set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
gpt attributes=0x8000000000000001

Target volumes are S:\ = System Reserved, W:\ = Windows, R:\ = Recovery partition

3. Use DISM to extract install.wim to the target volume.
Code:
dism /Apply-Image /ImageFile:C:\path\to\install.wim /Index:1 /ApplyDir:W:\

Enable the Recovery partition. Copy EFI files from the install image, or your PC's current boot drive.
Code:
mkdir R:\Recovery\WindowsRE
xcopy /h W:\Windows\System32\Recovery\Winre.wim R:\Recovery\WindowsRE\
W:\Windows\System32\Reagentc /Setreimage /Path R:\Recovery\WindowsRE /Target W:\Windows
W:\Windows\System32\Reagentc /Info /Target W:\Windows

W:\Windows\System32\bcdboot W:\Windows /s S: /f ALL

4. For bcdstore, follow the usual commands for setting up a dual-boot.

5. You still need to reboot into the new Windows to finish OOBE and other provisioning tasks.

Now can you do this without scripting, or a long list of manual commands? No, because Setup assumes you're doing a clean install or upgrading an existing system drive. There's no concept of installing to a different hosted drive, because the install expects to immediately reboot into the new image as soon as Setup has finished prepping.

I'm sure someone in the IT community has written a set of scripts to perform this task, but it's not something NTLite can automate.

 
Thanks for detailed info garlin. Appreciate the help. Given me a few idea's. This bit specifically stuck out as something I need to solve...

There's no concept of installing to a different hosted drive, because the install expects to immediately reboot into the new image as soon as Setup has finished prepping.

I know it often reboots once or more times. The different hardware isn't a problem as Windows will often just install the extra driver's needed.

It's the fact it reboot's, and wants to use current system partition, rather than installation drive that is the problem.

Sure it's possible - just haven't got the answer yet.

Although - easiest solution, ATM, would be to either just install ISO to VM, or get another machine and install to that, take a backup image, and then restore that to drive in question to other drives. Trying to find simplest/quickest solution. That probably could be scriptable/automated, so maybe that is best option.

Nice to know how things work though, so appreciate the detailed help!
 
Last edited:
It's the fact it reboot's, and wants to use current system partition, rather than installation drive that is the problem.
For the last step in WinPE, Setup configures the bcdstore to restart directly into install disk. It has to ignore whatever default boot device is your normal preference, so the install continues from the right disk.

Sometimes you see users complain about the WinPE error that "Windows cannot update the boot configuration". This is that step. In theory, it has to respect the old bcdstore and add a dual-boot instance. The tricky part is if your existing bcdstore is messy, there's a chance Setup (or you) does the wrong logic and ends up with broken boot info.

Although - easiest solution, ATM, would be to either just install ISO to VM, or get another machine and install to that, take a backup image, and then restore that to drive in question to other drives. Trying to find simplest/quickest solution. That probably could be scriptable/automated, so maybe that is best option.
Some folks do this solution, install inside a VM and export a sysprepped (generalized) image created on a small VHD/VHDX volume. Then volume copy to a target disk, boot into the image, and expand the volume to the drive's full size.

But you're still stuck with adding bcdstore entries. Maybe using of those bcdedit GUI tools is simpler.
 
But you're still stuck with adding bcdstore entries. Maybe using of those bcdedit GUI tools is simpler.
EasyBCD(free for home use) to create a boot entry and GimageX to Apply image.

Note - do not extract wim file to required location with 7Zip, you can have problems extracting the image. GimageX works well and havnt had any problems with it.

Note - EasyBCD requires registration to download from its home site, to download without registrating from MajorGeeks using the Download@MajorGeeks options.
 
Last edited:
Again, really appreciate detailed info. - Think the easiest option's I mentioned are the way to go, but it is nice to know these thing's.

On a different topic, when trying to install software and other thing's in NTLite'd ISO, I could never get it to work properly (I tried loads of different option's) until I scripted it manually with OEM folder - sort-of simplest option (if you can do some basic scripting/config files), but then it worked every time.

Thanks to @George King's thread for more detailed info., with own modification's

 
Last edited:
On a different topic, when trying to install software and other thing's in NTLite'd ISO, I could never get it to work properly (I tried loads of different option's) until I scripted it manually with OEM folder - sort-of simplest option (if you can do some basic scripting/config files), but then it worked every time.
For reference - Problem was, some install/config part always hung while installing/config'ing - Never happened with OOBE/OEM/George King's method
 
What the OOBE.cmd solution does is try to solve two problems:
- Post-Setup (via SetupComplete.cmd) doesn't run on PC with BIOS product keys
- Post-Setup doesn't run in a context with user interaction

MS changed the execution context for W10/11 to hide Post-Setup behind a splash scren, and deliberately provides no user interaction.

George King's workaround is to hack a DLL, so his script gets executed at a different install phase. This avoids the hidden screen problem. It's not what MS intended, and there are some subtle differences because of the install timing.

NTLite will the newer default mode solves the Post-Setup doesn't run with OEM keys problem.

OOBE.cmd is more of a custom solution. NTLite tries to closely following the book based on how Windows install is intended to work, as outlined in MS imaging docs.
 
Again, appreciate info. but from multiple test's, plus a few personal mod's, it was the only one I could get to work reliably, for everything I was trying to do, across multiple Windows edition's - most thing's worked in usual way, but some thing's just ended up hanging during install - This way didn't + and was most reliable, based on my tests - and, I did a lot.

Ultimately, whilst I do care what the book says, I prefer more if something works reliably and, as Windows isn't known for always being consistent in all area's, well... I go for most reliable, or if needs be - what I need for a specific job.

Will post back about my experience's though.
 
Last edited:
Back
Top