New
#10
yes.
Probably only need to change the files on recov partition when it is a change in major version.
@Kari, you could do this: then you just need to type in the driveletter e.g. F in the red bit
Code:@ECHO OFF SET DRIVELETTER= ECHO. (set WINLOADER=) for /f "usebackq tokens=1,2" %%G in (`bcdedit.exe /enum {current} ^| find "path"`) do set WINLOADER=%%H ECHO. (set LCAL=) for /f "usebackq tokens=1,2" %%G in (`bcdedit.exe /enum {current} ^| find "locale"`) do set LCAL=%%H ECHO. bcdedit /create {ramdiskoptions} /d "Ramdisk" bcdedit /set {ramdiskoptions} ramdisksdidevice partition=%DRIVELETTER%: bcdedit /set {ramdiskoptions} ramdisksdipath \boot\boot.sdi for /f "tokens=2 delims={}" %%i in ('bcdedit.exe /create /d "Recovery" /application OSLOADER') do (set guid={%%i}) bcdedit /set %guid% device ramdisk=[%DRIVELETTER%:]\sources\boot.wim,{ramdiskoptions} bcdedit /set %guid% path %WINLOADER% bcdedit /set %GUID% locale %LCAL% bcdedit /set %guid% osdevice ramdisk=[%DRIVELETTER%:]\sources\boot.wim,{ramdiskoptions} bcdedit /set %guid% systemroot \windows bcdedit /set %guid% winpe yes bcdedit /set %guid% detecthal yes bcdedit /displayorder %guid% /addlast
Thanks @SIW2, that's a good idea. Don't understand why I didn't think about it in the first place.
Edited tutorial, changing the batch file to ask drive letter. However, as I wanted to make it a bit more "elegant" , I added some visual eye candy and made a simple check to assure user has entered a correct drive letter.
New, edited batch:
Code:@ECHO OFF TITLE Add Recovery to Windows boot menu :SETLETTER CLS ECHO. ECHO ################################################### ECHO # # ECHO # This batch file creates recovery environment # ECHO # adding it to Windows boot menu. # ECHO # # ECHO ################################################### ECHO. SET /P DRIVELETTER= ^-- Please enter drive letter for your custom recovery partition (without colon): IF NOT EXIST %DRIVELETTER%:\sources\boot.wim ECHO. & ECHO No valid Windows image found on given partition %DRIVELETTER% &ECHO. & PAUSE & GOTO :SETLETTER ECHO. bcdedit /create {ramdiskoptions} /d "Ramdisk" bcdedit /set {ramdiskoptions} ramdisksdidevice partition=%DRIVELETTER%: bcdedit /set {ramdiskoptions} ramdisksdipath \boot\boot.sdi for /f "tokens=2 delims={}" %%i in ('bcdedit.exe /create /d "Recovery" /application OSLOADER') do (set guid={%%i}) bcdedit /set %guid% device ramdisk=[%DRIVELETTER%:]\sources\boot.wim,{ramdiskoptions} bcdedit /set %guid% path \windows\system32\winload.efi bcdedit /set %guid% osdevice ramdisk=[%DRIVELETTER%:]\sources\boot.wim,{ramdiskoptions} bcdedit /set %guid% systemroot \windows bcdedit /set %guid% winpe yes bcdedit /set %guid% detecthal yes bcdedit /displayorder %guid% /addlast
Kari
In the same way you have to create a new install media for each new feature upgrade, you must create a new recovery environment for it.
Once created, you don't have to run the batch file again. When Windows will for instance be upgraded to version 1809 late this year, you just do the Part One from tutorial capturing new image. Then, delete contents on Recovery partition replacing everything with contents of version 1809 ISO image, and finally replace the install.wim or install.esd file in its Sources folder with your custom install.wim.
Might take 10 or 15 minutes of your time twice a year but is worth of it.
Kari
Hi,
I followed this tutuorial. It did create a new option in the boot menu. However when I boot from the recovery partition WinPE loads "loading files" after tha a command prompt starts with wpeinit. Then it waits. I need to find the drive letter for my recovery partition then I can start setup.exe.
Should it not boot from the the recovery parthtion automatically using setup.exe. Perhaps my ISO was created wrong
Thanks
The recovery option in boot menu, when recovery partition is setup correctly as told in this tutorial, boots to this:
On the other hand, if boot media is a normal WinPE media (tutorial), it boots to Command Prompt and runs wpeinit command to enable networking.
Sounds to me that you boot to WinPE.
Kari
Yes, there was a problem with boot.wim. I corrected it and now it works. I modified boot.wim earlier with language packs and driver and it grew almost to 800 MB. I took the one which was shipped and only injected the language packs I needed. Now it is fine and it boots directly to setup.exe with the choices to select languages to continue setup. It is a nice thing.
Thank you for this tutorial!!