Change Boot Sequence One Time

This allows you to return the last boot entry in the boot table, and then use bcdedit /bootsequence GUID to make a one-time change to the boot sequence.

@echo off
color 0c
cls
title One-time Boot Sequence Change
echo Fetching last boot entry…
ping.exe -n 4 127.0.0.1>nul
bcdedit>bootcfg.txt
for /f “tokens=*” %%a in (‘findstr /c:identifier bootcfg.txt’) do echo %%a>GUID.txt
for /f “tokens=2” %%b in (GUID.txt) do set VAL=%%b
cls
echo The last boot entry GUID is
echo %VAL%
echo.
color 0a
ping.exe -n 4 127.0.0.1>nul
echo Changing default boot sequence…
ping.exe -n 4 127.0.0.1>nul
bcdedit /bootsequence %VAL%
ping.exe -n 4 127.0.0.1>nul
echo Boot sequence has been changed!
ping.exe -n 4 127.0.0.1>nul
pause

email me