How to Check if Fast Startup is Enabled in Batch Script
Fast Startup (also known as Hybrid Boot or Hybrid Shutdown) is a Windows feature introduced in Windows 8 that speeds up boot times by saving the kernel session to a hibernation file (hiberfil.sys) during shutdown. Instead of performing a full cold boot, Windows resumes the saved kernel state, dramatically cutting startup time.
While this sounds like a clear win, Fast Startup introduces subtle problems. It prevents clean dual-boot switching, can lock NTFS partitions (preventing Linux from mounting them), interferes with Windows Update installations, and causes issues with Wake-on-LAN. System administrators frequently need to verify its status before proceeding with maintenance tasks.
In this guide, we will explore how to determine whether Fast Startup is enabled using Batch Script by querying the Windows Registry.
Where the Setting Lives
The Fast Startup toggle is stored as a single DWORD value in the registry:
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power
Value Name: HiberbootEnabled
Type: REG_DWORD
1= Fast Startup is Enabled.0= Fast Startup is Disabled.
Method 1: Simple Registry Check
The most direct way to check the value is to query the registry key using the REG QUERY command and parse the output.
@echo off
setlocal
echo Checking Fast Startup Status...
set "reg_key=HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power"
set "reg_val=HiberbootEnabled"
:: Query the registry
set "result="
for /f "tokens=2*" %%A in ('reg query "%reg_key%" /v %reg_val% 2^>nul ^| findstr /i "%reg_val%"') do (
set "result=%%B"
)
if not defined result (
echo [WARNING] Could not find HiberbootEnabled key.
echo Fast Startup may not be supported on this system.
pause
exit /b 1
)
:: The result is in hex (0x0 or 0x1)
if "%result%"=="0x1" (
echo [RESULT] Fast Startup is ENABLED.
) else if "%result%"=="0x0" (
echo [RESULT] Fast Startup is DISABLED.
) else (
echo [RESULT] Unexpected value: %result%
)
pause
How the Parsing Works
The output of reg query for a DWORD looks like:
HiberbootEnabled REG_DWORD 0x1
The columns are separated by variable amounts of whitespace. Using tokens=2* with the default whitespace delimiter, the for /f loop assigns REG_DWORD to %%A and the remainder of the line (0x1) to %%B. We capture %%B as the result.
Using tokens=3 as a shorthand works in many cases, but tokens=2* is more resilient. The * in 2* means "everything from token 2 onward as a second variable," which correctly handles values that might contain spaces. While 0x1 does not contain spaces, this pattern is a defensive parsing habit that applies well to other registry value types.
Method 2: A Comprehensive Status Report
For administrative dashboards or log files, you might want to check Fast Startup alongside related hibernation settings to give a complete picture.
@echo off
setlocal enabledelayedexpansion
echo =============================================
echo FAST STARTUP STATUS REPORT
echo =============================================
echo.
set "power_key=HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power"
:: 1. Check HiberbootEnabled (Fast Startup)
set "fast_startup=Unknown"
for /f "tokens=2*" %%A in ('reg query "%power_key%" /v HiberbootEnabled 2^>nul ^| findstr /i "HiberbootEnabled"') do (
if "%%B"=="0x1" (set "fast_startup=ENABLED") else if "%%B"=="0x0" (set "fast_startup=DISABLED")
)
echo Fast Startup: !fast_startup!
:: 2. Check if Hibernation is available (prerequisite for Fast Startup)
set "hib_available=Unknown"
set "hib_line="
for /f "tokens=*" %%L in ('powercfg /availablesleepstates 2^>nul ^| findstr /i "Hibernate"') do (
set "hib_line=%%L"
)
if defined hib_line (
echo !hib_line! | findstr /i /c:"not available" >nul 2>&1
if !errorlevel! equ 0 (
set "hib_available=NO"
) else (
set "hib_available=YES"
)
) else (
set "hib_available=NO (not listed by powercfg)"
)
echo Hibernation Avail: !hib_available!
:: 3. Check hiberfil.sys existence
if exist "%SystemDrive%\hiberfil.sys" (
echo Hiberfil.sys: Present on %SystemDrive%
) else (
echo Hiberfil.sys: Not Found on %SystemDrive%
)
:: 4. Determine effective status
echo.
echo =============================================
if "!fast_startup!"=="ENABLED" (
if "!hib_available!"=="YES" (
echo [STATUS] Fast Startup is ON and OPERATIONAL.
echo Shutdowns save kernel state to hiberfil.sys.
echo For a true cold shutdown, use: shutdown /s /full /f /t 0
) else (
echo [STATUS] Fast Startup registry key is ENABLED, but hibernation
echo is unavailable. Fast Startup is NOT actually operational.
echo Enable hibernation with: powercfg /h on
)
) else if "!fast_startup!"=="DISABLED" (
echo [STATUS] Fast Startup is OFF. All shutdowns are cold shutdowns.
) else (
echo [STATUS] Could not determine Fast Startup state.
)
pause
Why Hibernation Matters
Fast Startup piggybacks on the hibernation infrastructure. If hibernation has been disabled (via powercfg /h off), the HiberbootEnabled key might still say 1, but Fast Startup will not actually function because there is no hiberfil.sys to write to. Checking both values gives administrators the complete and accurate status.
The powercfg /a command (aliased as powercfg /availablesleepstates) lists both available and unavailable sleep states. Simply searching for the word "Hibernate" in its output is not enough, you must also check whether that line contains "not available" or similar disqualifying text. The script above performs this two-stage check to avoid false positives.
Method 3: Using PowerShell for a Clean Boolean
If you prefer a simple true/false output that can be captured into a Batch variable without hex parsing:
@echo off
setlocal
:: Capture the result of a PowerShell query
set "fs_value="
for /f %%A in ('powershell -NoProfile -Command ^
"(Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power' -Name HiberbootEnabled -ErrorAction SilentlyContinue).HiberbootEnabled"') do (
set "fs_value=%%A"
)
if "%fs_value%"=="1" (
echo Fast Startup: ENABLED
) else if "%fs_value%"=="0" (
echo Fast Startup: DISABLED
) else (
echo Fast Startup: UNKNOWN or NOT SUPPORTED
)
pause
This method returns a clean 1 or 0 without the 0x prefix, simplifying conditional logic.
Common Mistakes
The Wrong Way: Checking the Wrong Registry Path
:: WRONG - This is the Group Policy path, not the actual setting
reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v HiberbootEnabled
While Group Policy can enforce a Fast Startup setting at this path, this key only exists if a GPO has been explicitly configured. On standalone workstations, this key is absent, and your script would incorrectly report "Fast Startup not found." The correct path is always HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power.
The Wrong Way: Assuming Fast Startup is Always Available
:: WRONG - Tablets and VMs may not support hibernation at all
if "%result%"=="0x0" echo Fast Startup is off, let's turn it on!
Before trying to enable Fast Startup, always verify that hibernation is supported (via powercfg /availablesleepstates or by checking for hiberfil.sys). Virtual machines and some embedded devices do not support hibernation at all.
The Wrong Way: Using shutdown /s to Bypass Fast Startup
:: WRONG on modern Windows - /s alone still triggers Fast Startup
shutdown /s /f /t 0
On Windows 10 version 1903 and later, shutdown /s performs a hybrid shutdown when Fast Startup is enabled. To force a true full shutdown that completely unloads the kernel, use shutdown /s /full /f /t 0. The /full flag was introduced specifically to override Fast Startup behavior. On older Windows versions where /full is not available, shutdown /s /f /t 0 does perform a cold shutdown.
Practical Use Case: Pre-Update Verification
Windows Updates sometimes require a true cold restart to install kernel-level patches. If Fast Startup is enabled, a standard shutdown performs a hybrid shutdown instead of a true reboot, which can cause updates to fail silently.
Here is a script that verifies the state before initiating an update restart:
@echo off
setlocal
echo Preparing for Windows Update restart...
:: Check Fast Startup status
set "fs="
for /f "tokens=2*" %%A in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled 2^>nul ^| findstr /i "HiberbootEnabled"') do set "fs=%%B"
if "%fs%"=="0x1" (
echo [WARNING] Fast Startup is enabled.
echo Performing a FULL restart to bypass hybrid boot...
echo The system will restart in 10 seconds.
shutdown /r /f /t 10
) else (
echo [OK] Fast Startup is off. Standard restart is safe.
shutdown /r /f /t 10
)
Using shutdown /r (restart) is preferred over shutdown /s (shutdown) for update scenarios because it automatically powers the machine back on after the full kernel unload. A restart always performs a cold boot cycle regardless of Fast Startup status, making it the correct choice for finalizing pending updates. The /s plus manual power-on approach is only necessary in edge cases where you specifically need the machine to remain off.
Best Practices
- Check both the registry AND hibernation availability: The
HiberbootEnabledregistry value alone does not tell you if Fast Startup is actually operational. - Initialize variables before parsing: Always
set "result="before afor /floop to ensure stale values from a previous run or the existing environment do not produce false results. - Use
tokens=2*for registry parsing: This pattern is more resilient thantokens=3when parsingreg queryoutput, as it correctly handles value data that may contain spaces. - Use
shutdown /rfor updates: A restart always performs a true cold boot cycle, bypassing Fast Startup regardless of its setting. Useshutdown /s /fullonly when you need the machine to stay powered off. - Use
%SystemDrive%instead of hardcodedC:\: The system drive is not alwaysC:. Using the environment variable ensures the script works on non-standard installations. - Log the result: In automated deployment or update scripts, always log the Fast Startup status to a file so that post-mortem analysis of failed updates can quickly identify this as a potential cause.
Conclusion
Checking whether Fast Startup is enabled in Batch Script is a straightforward registry query against the HiberbootEnabled DWORD value. By parsing the result with a for /f loop and supplementing the check with a hibernation availability verification, administrators gain a complete and accurate picture of the system's boot behavior. This knowledge is essential for troubleshooting update failures, dual-boot conflicts, and unexpected shutdown behaviors.