@echo off setlocal set BCDEDIT=%SYSTEM%\bcdedit.exe if not exist %BCDEDIT% exit 1 for /f "tokens=3" %%A in ('%BCDEDIT% /create /d "PXE boot" /application bootsector') do set guid=%%A %BCDEDIT% /set %guid% device partition=%SystemDrive% %BCDEDIT% /set %guid% path \grldr.mbr REM you can use /addfirst instead, if you want %BCDEDIT% /displayorder %guid% /addlast REM this sets a 5 second timeout until the default entry is booted REM feel free to adjust to your needs, but NEVER set it to 0 or 1 REM in combination with using /default below unless you don't ever REM intend to boot back into Windows again. %BCDEDIT% /timeout 5 REM "bootsequence" means only the single, next reboot will default to this %BCDEDIT% /bootsequence %guid% /addfirst REM alternatively, you can uncomment this and make the ThinClient REM boot option the default boot option REM %BCDEDIT% /default %guid% endlocal