New
#240
msconfig>boot tab delete what you dont want
It wont allow you to delete the entry you are booted into. Set the entry you want as default you should be able to get rid of the others.
post a screenshot of what it says like this:
See my attached pictures 1-5. The first is the double win10 shown in the bootup options displayorder list with "on volume 3" followed by MyRecoveryWin10Pro; second is the msconfig showing the two win10pro options in the list; third, is the popup showing "access denied" after I selected the second bootup option to delete its entry. Note: in the past I had selected "cancel" even though I'm administrator. However, I now selected ok to both popups. ; fourth, I used bcdedit to show what is in the bootup options list and the displayorder {ID} entries to confirm that the other win10pro entry isn't there; fifth, I then rebooted to see what bootup options would be displayed.
Thus, it now only shows one win10 option and not two. So ignoring the access denied and hitting ok made it work the way as expected although I don't know why I got access denied to begin with.
- - - Updated - - -
One of the things that needs to be added to the Recovery.bat file posted here is the the storing of the {ID} # that was created to a temp file and then a Recoveryx64Del.bat file that uses this saved ID to remove the ramdisk and its WinRecovery display name, so that one can bootup without showing the multiple display options.
So my Recoverx64.bat changed the path to /x64/sources since my Recovery partition has both the x32 and x64 but with my modified install.wim put in the x64/sources subdirectory. The files on this partition were those that would be created my mediacreator tool.
My Recoveryx64Del.bat uses the MyRecoveryWin10Proguid.dat file to remove the ramdisk and bootup option for MyRecoveryWin10Pro. The dat file content specifies the ID that was created as {b129db86-95e9-11ee-820d-e78cb99e2e21}
for example.
See the /x64/sources and the last line that echoes the guid to the dat file.@ECHO OFF
TITLE Add Recovery to Windows boot menu
:SETLETTER
CLS
ECHO.
ECHO ###################################################
ECHO # #
ECHO # This batch file creates recovery environment #
ECHO # for x64 adding it to Windows boot menu. #
ECHO # The recovery partition also contains x86 but #
ECHO # not used - only x64 is used. #
ECHO ###################################################
ECHO.
SET /P DRIVELETTER= ^-- Please enter drive letter for your custom recovery partition (without colon):
IF NOT EXIST %DRIVELETTER%:\x64\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%:
REM note: the sdi file may need \x64 added to path. There is one in the root and in the x86 subdirectory
bcdedit /set {ramdiskoptions} ramdisksdipath \boot\boot.sdi
for /f "tokens=2 delims={}" %%i in ('bcdedit.exe /create /d "MyRecoveryWin10pro" /application OSLOADER') do (set guid={%%i})
bcdedit /set %guid% device ramdisk=[%DRIVELETTER%:]\x64\sources\boot.wim,{ramdiskoptions}
bcdedit /set %guid% path \windows\system32\winload.efi
bcdedit /set %guid% osdevice ramdisk=[%DRIVELETTER%:]\x64\sources\boot.wim,{ramdiskoptions}
bcdedit /set %guid% systemroot \windows
bcdedit /set %guid% winpe yes
bcdedit /set %guid% detecthal yes
bcdedit /displayorder %guid% /addlast
REM Write the guid to a file so that it can be used by RecoveryWin10Prox64Del.bat to remove the bootup MyRecoveryWin10Pro option
echo %guid% >MyRecoveryWin10proguid.dat
pause
@Of course, one could create a batch file to make it more versatile by adding command line switches/data to the batch files command line in cases where one has more than one bootup option.ECHO OFF
TITLE Remove Recovery Option "MyRecoveryWin10pro" from Windows boot menu
CLS
REM Remove the bcdedit identifier tag assigned for removal.
set /p guid= <MyRecoveryWin10proguid.dat
ECHO "MyRecoveryWin10pro guid removed. " %guid%
bcdedit /delete %guid% /cleanup
REM Remove the ramdiskoptions
bcdedit /delete {ramdiskoptions} /f
REM Remove the guid from the displayorder list of bootmgr
bcdedit /displayorder %guid% /remove
REM Remove guid environment variable
set guid=
REM Delete the temporary data file that has the guid
del /f MyRecoveryWin10proguid.dat
I'm assuming that as the number of bootup option list increases, that the font size size is reduced automatically, and that a scroll window appears if the number is beyond the number that can be displayed on one screen.
Question: I've done the same for my windows Server 2022 using the batch file method. However, what is displayed is the WinServer 2022 name, but the MyRecoveryWinSrvr2022 name I specified doesn't show. It only shows "ramdisk" and when selected will recover my win server 2022 from my wim file. Moreover, the background color doesn't change, nor does the font size increase like the win10 pro bootup options do. Note: I'm not mixing Win server 2022 boot and recovery at the same time as win10 pro and recovery. They both have their own batch files and I run the delete batch file on win10pro before I switch over to the set of batch files for win server 2022 and vice versa.
Last edited by swegmike; 20 Dec 2023 at 07:41.