The answer is to slipstream the drivers using CMD from a live CD directly into the installation, after slipstreaming the drivers into the USB stick's boot.wim
file on the usb.
If you don't slipstream into the USB stick itself, it might not be able to read your disk, for example, Windows 7 does not include NVMe drivers so you need to add the two hotfixes and the drivers.
THE TRICK: You can directly mount a full windows install using dism
.
When you boot from a live CD (I used AOMEI USB environment which uses WinPE), make sure it can see the drive. As long as your recovery environment can see the drive over command prompt, you can slipstream the drivers and packages/hotfixes directly into a fully installed windows installation.
Open the CMD in the recovery environment, and first check where your windows is installed.
First check what drives are attached:
diskpart
list disk
If your disk is listed then you are good to continue. If not, then you need to put the right drivers, such as nvme drivers, into your recovery USB. You can use dism like shown below to directly slipstream the USB stick by finding the boot.wim (usually in /sources/boot.wim) and slipstreaming.
Once you get your disk listed, exit parted
exit
Now check which disk windows is installed on:
cd C:\
dir
dir
will tell you what's in that directory making it clear if it's the windows root directory or not. For CMD it's the same as ls
in a linux terminal.
If it's not in C:\ (probably won't be because it will probaby be the boot partition which WinPE will mount as the first drive letter), do the same for each drive letter until you find it. Mine was D:\
cd D:\
dir
Once you found the correct partition for the root of your windows install (the one with "Program Files" directory), now it's time to slipstream the drivers.
Make sure that you have another drive installed, or you copied the drivers somewhere you can access. Might even work to copy the drivers and pacakages folder into the root of your windows install.
I put them in a folder called tmp
which I put in the root of an external USB drive.
I put the windows hotfixes in E:\tmp\hotfix
in my case. I put the drivers in E:\tmp\drivers
. Of course, you need to do this ahead of time or from another computer.
Then dism
will find any hotfixes and drivers you put in there and install them all. Install like below.
Mount the image using dism
. The /Image:D:\
part is the trick. YOU CAN MOUNT THE INSTALLED WINDOWS DISK IN DISM! That is the not-obvious trick.
dism /Mount-Image /Image:D:\ /Add-Package /PackagePath:E:\tmp\hotfix
dism /Image:D:\ /Add-Driver /Driver:E:\tmp\drivers /Recurse /forceunsigned
dism /Unmount-Image /MountDir:C:\tmp\mount /Commit
If the above gives an error that says Mount-Image
doesn't work, it is using the older version of dism
. In that case, use /Mount-Wim
dism /Mount-Wim /Image:D:\ /Add-Package /PackagePath:E:\tmp\hotfix
dism /Image:D:\ /Add-Driver /Driver:E:\tmp\drivers /Recurse /forceunsigned
dism /Unmount-Wim /MountDir:C:\tmp\mount /Commit
You can also run this to get the help to see what the correct commands are for your version of dism
in case of any issues:
dism /?
After slipstreaming all the drivers and packages you need, you should be able to boot into the disk, it might ask you to reboot after finishing the install on the first boot. It worked for me.
The real secret to this all is the fact you can simply mount an entire windows installation partition in the same way as a boot.wim
file.