- Batchfile 70.6%
- VBScript 29.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| LICENSE | ||
| no_hibernate.bat | ||
| no_hibernate_auto.bat | ||
| README.md | ||
| silent.vbs | ||
NoHibernate
A lightweight Windows utility that prevents your laptop from sleeping when you close the lid by configuring the lid-close action to Do nothing on both AC power and battery power.
NoHibernate also supports automatically reapplying the configuration every five minutes using Windows Task Scheduler.
Included Files
| File | Description |
|---|---|
no_hibernate.bat |
Configures the active Windows power plan to do nothing when the lid is closed. |
no_hibernate_auto.bat |
Creates a scheduled task that reapplies the configuration every five minutes. |
silent.vbs |
Runs no_hibernate.bat without displaying a command prompt window. |
README.md |
Project documentation. |
Installation and Usage
Apply the configuration immediately
Run no_hibernate.bat. It configures the current power plan for both AC and battery operation.
Enable automatic reapplication
Run no_hibernate_auto.bat.
This creates a scheduled task named My 5 Minute Script, which executes silent.vbs every five minutes. The VBS script locates and silently launches no_hibernate.bat in the same directory.
Keep all three scripts in the same folder.
How It Works
- Configure lid-close behavior: Uses Windows
powercfgto setLIDACTIONto0for both AC and DC power. - Apply the configuration: Reactivates the current power scheme.
- Maintain the configuration: A scheduled task periodically reruns the script.
- Run silently: Windows Script Host launches the batch file without opening a visible command prompt.
Uninstallation
To disable automatic reapplication, open Task Scheduler (taskschd.msc), locate My 5 Minute Script, and delete it.
Alternatively, run:
schtasks /delete /tn "My 5 Minute Script" /f
This removes the scheduled task but does not restore your previous lid-close settings. Change those separately through Windows Power Options if needed.
Important Considerations
- Heat: A laptop left running with its lid closed may overheat if its ventilation is obstructed.
- Battery: The laptop may continue consuming power while closed.
- Scope: NoHibernate changes the lid-close action; it does not disable every possible sleep or hibernation trigger.
- Permissions: Scheduled task creation may require additional permissions depending on your Windows configuration.
- File paths: Keep
no_hibernate.batandsilent.vbstogether so the scripts can locate each other.
Credits
- P7MJ — Original idea and script.
- SpyDrone — Contributions toward making the script universal across Windows computers.