How to Enable or Disable Fast Startup in Batch Script
Fast Startup (Hybrid Boot) is a Windows feature that blends a traditional shutdown with hibernation. When shutting down, Windows saves the kernel session state to the hibernation file (hiberfil.sys), allowing the next boot to skip the full hardware initialization and driver loading phases. This can cut boot times by 30-70% on mechanical hard drives.
However, Fast Startup is not always desirable. It prevents true cold boots needed by Windows Update, locks NTFS volumes for dual-boot Linux setups, and can cause Wake-on-LAN issues in enterprise environments. In this guide, we will explore the complete process for enabling or disabling Fast Startup programmatically using Batch Script.
Prerequisites
Fast Startup has two dependencies that must be met:
- Hibernation must be supported and enabled: Fast Startup uses the
hiberfil.sysfile. If hibernation is disabled (powercfg /h off), Fast Startup cannot function regardless of its registry setting. - Administrator privileges: Modifying the registry key and hibernation settings requires elevation.
The Registry Key
The Fast Startup toggle is stored at:
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power
Value Name: HiberbootEnabled
Type: REG_DWORD
1= Fast Startup Enabled0= Fast Startup Disabled
Method 1: Disabling Fast Startup
This is the most common administrative action, typically performed to resolve dual-boot issues or prepare machines for clean Windows Update installations.
@echo off
setlocal
:: Verify Admin Rights
net session >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] This script must be run as Administrator.
pause
exit /b 1
)
echo Disabling Fast Startup...
:: Set the registry value to 0 (Disabled)
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t REG_DWORD /d 0 /f >nul
if %errorlevel% == 0 (
echo [SUCCESS] Fast Startup has been DISABLED.
echo All future shutdowns will perform a full cold shutdown.
) else (
echo [ERROR] Failed to modify the registry.
)
pause
No Reboot Required (But Behavior Changes on Next Shutdown)
Unlike many system-level registry changes, modifying HiberbootEnabled does not require an immediate reboot to take effect. The new value is evaluated the next time the user performs a "Shut down" operation. The very next boot after that shutdown will be a true cold boot.
Method 2: Enabling Fast Startup
If Fast Startup was previously disabled and you want to re-enable it (for example, after a Windows Update cycle is complete), the process is the reverse.
@echo off
setlocal
:: Verify Admin Rights
net session >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] This script must be run as Administrator.
pause
exit /b 1
)
echo Enabling Fast Startup...
:: Step 1: Ensure Hibernation is turned on (prerequisite)
powercfg /h on >nul 2>&1
:: Step 2: Set the registry value to 1 (Enabled)
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t REG_DWORD /d 1 /f >nul
if %errorlevel% == 0 (
echo [SUCCESS] Fast Startup has been ENABLED.
echo Ensure hibernation is supported on this hardware.
) else (
echo [ERROR] Failed to modify the registry.
)
pause
Why We Run powercfg /h on First
If an administrator previously ran powercfg /h off to delete the hiberfil.sys file and free up disk space, setting HiberbootEnabled to 1 alone will not work. The kernel still has no hibernation file to write to. By running powercfg /h on first, we recreate the hiberfil.sys file at its default size (typically 40-75% of installed RAM), ensuring the infrastructure is in place.
Method 3: Interactive Toggle Script
For helpdesk technicians who need a quick tool to flip the setting back and forth during troubleshooting, an interactive toggle script is ideal.
@echo off
title Fast Startup Manager
setlocal
:: Verify Admin
net session >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] Run as Administrator.
pause
exit /b 1
)
:menu
cls
echo =============================================
echo FAST STARTUP MANAGER
echo =============================================
echo.
:: Read current status
set "status=UNKNOWN"
for /f "tokens=3" %%A in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled 2^>nul ^| findstr /i "HiberbootEnabled"') do (
if "%%A" == "0x1" (set "status=ENABLED") else (set "status=DISABLED")
)
echo Current Status: %status%
echo.
echo [1] Enable Fast Startup
echo [2] Disable Fast Startup
echo [0] Exit
echo.
set /p "opt=Select: "
if "%opt%" == "1" goto do_enable
if "%opt%" == "2" goto do_disable
if "%opt%" == "0" exit /b
goto menu
:do_enable
powercfg /h on >nul 2>&1
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t REG_DWORD /d 1 /f >nul
echo.
echo [OK] Fast Startup ENABLED.
pause
goto menu
:do_disable
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t REG_DWORD /d 0 /f >nul
echo.
echo [OK] Fast Startup DISABLED.
pause
goto menu
Handling the Group Policy Override
In enterprise environments managed by Active Directory, Fast Startup may be enforced via Group Policy. The GPO setting is stored at:
HKLM\SOFTWARE\Policies\Microsoft\Windows\System
Value: HiberbootEnabled
If this key exists and is set by a domain controller, your local script's changes to the Session Manager\Power key will be overridden on the next Group Policy refresh (every 90 minutes by default).
To detect this:
@echo off
:: Check if a GPO is overriding the local setting
reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v HiberbootEnabled >nul 2>&1
if %errorlevel% == 0 (
echo [WARNING] A Group Policy is controlling Fast Startup.
echo Local changes may be overridden automatically.
echo Contact your domain administrator to modify this policy.
) else (
echo [OK] No Group Policy override detected. Local changes will persist.
)
pause
Common Mistakes
The Wrong Way: Forgetting to Enable Hibernation
:: WRONG - Enabling Fast Startup without ensuring hibernation is active
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t REG_DWORD /d 1 /f
echo Done!
Output Concern:
The registry now reads "Fast Startup Enabled," and the Windows GUI will even show the checkbox as checked. But if hiberfil.sys does not exist (because powercfg /h off was run previously), Fast Startup silently does nothing. The boot time will not improve, and the administrator is left debugging a phantom issue.
The Wrong Way: Using REG_SZ Instead of REG_DWORD
:: WRONG - HiberbootEnabled is a DWORD, not a string
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t REG_SZ /d "0" /f
Writing the value as a string will cause the Windows kernel to ignore it entirely, as it expects a DWORD for this specific key.
Best Practices
- Always check Admin rights first: Modifying
HKLMregistry keys without elevation will silently fail or throw access denied errors. - Pair with
powercfg /h on: When enabling Fast Startup, always ensure hibernation is active. When disabling, you may optionally runpowercfg /h offto reclaim the disk space used byhiberfil.sys. - Detect GPO overrides: In managed environments, warn the user that domain policies may revert their changes.
- Use
shutdown /s /full: On Windows 10 version 1903+, you can useshutdown /s /f /t 0to perform a one-time full shutdown without permanently disabling Fast Startup.
Conclusion
Enabling or disabling Fast Startup via Batch Script is a single REG ADD operation targeting the HiberbootEnabled DWORD value. The critical nuance lies in ensuring that hibernation infrastructure is in place when enabling the feature, and in detecting Group Policy overrides that can silently revert local changes. By wrapping these checks into a clean, interactive script, system administrators gain a reliable, reusable tool for managing boot behavior across their fleet.