Advanced Startup Options and UEFI

Discussion in 'Windows 8' started by shinji, Jan 22, 2013.

  1. shinji

    shinji MDL Novice

    Sep 27, 2009
    20
    1
    0
    Is there a way to add Advanced Startup Options to the UEFI startup menu? If so how would I go about doing it?

    You may make the instructions somewhat generic as I realize the steps can be system specific.
     
  2. =)(=

    =)(= Guest

    I think that he means if it is possible to add it to NVRAM, so it shows up in the boot menu. I don't think it is possible.
     
  3. anarchist9027

    anarchist9027 MDL Expert

    Oct 30, 2010
    1,320
    667
    60
    I'm pretty sure it is. Don't quote me on this but I think you need EasyBCD and add WinRE.wim to the boot settings; I'm pretty positive thats what he means.
     
  4. EFA11

    EFA11 Avatar Guru

    Oct 7, 2010
    8,796
    6,751
    270
    #5 EFA11, Jan 24, 2013
    Last edited by a moderator: Apr 20, 2017
  5. HALIKUS

    HALIKUS MDL Addicted

    Jul 29, 2009
    527
    369
    30
    #7 HALIKUS, Dec 5, 2013
    Last edited by a moderator: Apr 20, 2017
    I'm smart and dumb on this topic :) I have methods to boot most things from the bcd, i'm just not sure what you mean by the Advanced Startup. I assume you mean WinRE.wim, which is just a boot.wim essentially. If you point me to a specific file you want to boot, i'm sure theres a way. I have a triple boot, a few WinPEs, Grub4dos, Ubuntu, and Win8 safemode in my main bcd menu.

    If it is a wim you want to boot, heres an automated way i made in autoit. It searches for sources\boot.wim, copies it to windows\boot.wim, and then adds a bcd entry. For efi you need to use winload.efi, not exe. If you indeed want to use WinRE, just point it to \recovery\%GUI ID%\winre.wim

    Code:
    #RequireAdmin
    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Icon=WinPE.ico
    #AutoIt3Wrapper_Compression=4
    #AutoIt3Wrapper_Compile_Both=y
    #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
    #AutoIt3Wrapper_Add_Constants=n
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <EditConstants.au3>
    #include <Array.au3>
    #include <String.au3>
    #include <Process.au3>
    
    
    $bcdedit = @SystemDir & "\bcdedit.exe"
    
    ;MsgBox(4096, "Add Boot.wim to BCD", "Do you want to add the WinPE to the BCD?  If not cancel now as startupcomplete is done.  This will need a boot.wim in Windows dir to function.", 2)
    $bootwim = _FindFileBootwim("sources\boot.wim")
    ;If FileExists($bootwim & "\sources\boot.wim") Then
    FileCopy($bootwim & "\sources\boot.wim", @WindowsDir & "\", 9)
    
    
    ;Winpe Ramdisk
    If FileExists(@WindowsDir & "\boot.wim") Then
    ;RunWait(@ComSpec & " /c " & $bcdedit & ' /create /d "WinPERamdisk" /device > ' & @TempDir & "\bcd_out.txt", @SystemDir & "\", @SW_HIDE)
    RunWait(@ComSpec & " /c " & $bcdedit & ' /create /device > ' & @TempDir & "\bcd_out.txt", @SystemDir & "\", @SW_HIDE)
    Sleep(1000)
    $file = FileOpen(@TempDir & "\bcd_out.txt", 0)
    $line = FileReadLine($file)
    FileClose($file)
    $pos1 = StringInStr($line, "{")
    $pos2 = StringInStr($line, "}")
    If $pos2 - $pos1 = 37 Then
    $ramdisk = StringMid($line, $pos1, $pos2 - $pos1 + 1)
    ;RunWait(@ComSpec & " /c " & $bcdedit & " /set " & $ramdisk & ' description "WinPERamdisk"', @SystemDir & "\", @SW_HIDE)
    RunWait(@ComSpec & " /c " & $bcdedit & " /set " & $ramdisk & " ramdisksdidevice partition=c:", @SystemDir & "\", @SW_HIDE)
    RunWait(@ComSpec & " /c " & $bcdedit & " /set " & $ramdisk & " ramdisksdipath \Windows\system32\boot.sdi", @SystemDir & "\", @SW_HIDE)
    EndIf
    
    
    ;boot.wim
    RunWait(@ComSpec & " /c " & $bcdedit & ' /create /d "WinPE" /application osloader > ' & @TempDir & "\bcd_out2.txt", @SystemDir & "\", @SW_HIDE)
    ;RunWait(@ComSpec & " /c " & $bcdedit & ' /create /application osloader > ' & @TempDir & "\bcd_out2.txt", @SystemDir & "\", @SW_HIDE)
    Sleep(1000)
    $2file = FileOpen(@TempDir & "\bcd_out2.txt", 0)
    $2line = FileReadLine($2file)
    FileClose($2file)
    $2pos1 = StringInStr($2line, "{")
    $2pos2 = StringInStr($2line, "}")
    If $2pos2 - $2pos1 = 37 Then
    $guid = StringMid($2line, $2pos1, $2pos2 - $2pos1 + 1)
    RunWait(@ComSpec & " /c " & $bcdedit & " /set " & $guid & " systemroot \Windows", @SystemDir & "\", @SW_HIDE)
    RunWait(@ComSpec & " /c " & $bcdedit & " /set " & $guid & " detecthal Yes", @SystemDir & "\", @SW_HIDE)
    RunWait(@ComSpec & " /c " & $bcdedit & " /set " & $guid & " winpe Yes", @SystemDir & "\", @SW_HIDE)
    RunWait(@ComSpec & " /c " & $bcdedit & " /set " & $guid & " osdevice ramdisk=[c:]\windows\boot.wim," & $ramdisk, @SystemDir & "\", @SW_HIDE)
    RunWait(@ComSpec & " /c " & $bcdedit & " /set " & $guid & " device ramdisk=[c:]\windows\boot.wim," & $ramdisk, @SystemDir & "\", @SW_HIDE)
    RunWait(@ComSpec & " /c " & $bcdedit & " /set " & $guid & " path \Windows\system32\winload.exe", @SystemDir & "\", @SW_HIDE)
    ;RunWait(@ComSpec & " /c " & $bcdedit & " /set " & $guid & ' description "WinPE"', @SystemDir & "\", @SW_HIDE)
    RunWait(@ComSpec & " /c " & $bcdedit & " /set " & $guid & ' locale en-US', @SystemDir & "\", @SW_HIDE)
    RunWait(@ComSpec & " /c " & $bcdedit & " /displayorder " & $guid & ' /addlast', @SystemDir & "\", @SW_HIDE)
    RunWait(@ComSpec & " /c " & $bcdedit & ' Default {current}', @SystemDir & "\", @SW_HIDE)
    RunWait(@ComSpec & " /c " & $bcdedit & ' /set {current} bootmenupolicy standard', @SystemDir & "\", @SW_HIDE)
    RunWait(@ComSpec & " /c " & $bcdedit & ' /timeout 10', @SystemDir & "\", @SW_HIDE)
    FileDelete(@TempDir & "\bcd_out2.txt")
    FileDelete(@TempDir & "\bcd_out.txt")
    EndIf
    
    EndIf
    
    ;Find bootwim
    Func _FindFileBootwim($bootwim, $sSearch4 = "ALL")
    If StringLeft($bootwim, 1) <> "\" Then $bootwim = "\" & $bootwim
    Local $aDrives4 = DriveGetDrive($sSearch4)
    For $i4 = 1 To $aDrives4[0]
    If FileExists($aDrives4[$i4] & $bootwim) Then Return $aDrives4[$i4]
    Next
    Return SetError(1, 0, "")
    EndFunc   ;==>_FindFileBootwim
    
     
  6. monitor

    monitor MDL Novice

    Aug 29, 2009
    20
    2
    0
    you could use BootuiTuner to modify it.
    This utility is by winAero and works on windows 8.1
    sorry, can't supply the link