Windows has several independent mechanisms that control when a machine sleeps. Most guides tell you to change one setting and call it done. The problem is that there are at least five different ways sleep can kick in, and disabling one doesn't always stop the others.
This guide covers every method — from the built-in Settings UI to a one-command PowerShell override — and explains which one is right depending on whether you need the machine awake for the next two hours or the next two months.
Temporary vs. Permanent: The Question No Guide Asks
Before picking a method, answer one question: do you need the machine awake right now, or always?
These are genuinely different requirements that call for different solutions. Most guides treat them as the same problem and tell you to change a setting permanently — which works, but has real downsides when your laptop is running on battery or you forget to restore the setting before a presentation in a dark room where the screen is the only light.
- Temporary need — you're watching a presentation, running a long download, waiting on a remote desktop session, or giving a demo. You want the machine awake for the duration, then back to normal. Use a tray app (SmartSleep) or a timed command-line override.
- Permanent need — you're running a home server, a media PC, a monitoring station, or any machine that should never sleep. Use Windows Settings or a power plan.
The most common mistake is opening Settings, setting sleep to "Never," solving the immediate problem, and forgetting to change it back. On a laptop, this drains battery faster, shortens display backlight life, and means the machine never enters low-power states when idle. Use a tray app or timed command if you only need this occasionally.
Five Methods at a Glance
Method 1: Vexifa SmartSleep (Recommended for Temporary Use)
Vexifa SmartSleep
Free · Microsoft Store · Windows 10 & 11 · System tray app
SmartSleep sits in the system tray and prevents Windows from sleeping with one click. It uses the Windows SetThreadExecutionState API to hold a sleep wake lock for as long as it's active. Click again to release it — your normal power settings resume exactly as they were.
How it works: SmartSleep calls Windows' SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED) API. This is the same mechanism Windows uses internally to prevent sleep during video playback, during presentation mode, and when an application is doing full-screen work. It doesn't change any system settings — it signals to the power manager that the current session requires the display and system to stay awake.
When you disable SmartSleep (or close it), the wake lock is released and Windows resumes normal power management immediately. There's nothing to undo, no settings to reset, no system state left behind.
- For presentations: Enable before starting, disable after. No sleep, no lock screen mid-slide.
- For downloads/long jobs: Enable while running, disable when done.
- For remote work: Keep enabled during your session so the machine doesn't lock you out of a remote desktop connection.
- For always-on machines: Set SmartSleep to launch at startup and enable automatically — the machine stays awake indefinitely until you manually disable it.
Vexifa SmartSleep is free on the Microsoft Store. Install takes under a minute. No account required.
Method 2: Windows Settings (Best for Permanent Changes)
Windows Power Settings
No install required · Permanent change until manually reverted
The simplest approach for machines that should permanently stay awake (servers, media centers, desktop workstations):
- Open Settings (Win + I)
- Go to System → Power & sleep (Windows 10) or System → Power (Windows 11)
- Under Sleep, set both "On battery power" and "When plugged in" to Never
- Optionally, set Screen to Never as well — this controls the display, sleep controls the system
On Windows 11, the path is slightly different: Settings → System → Power & battery → Screen and sleep. The setting names are the same.
Power settings control timeout-based sleep but not lid-triggered sleep. To change what happens when you close the lid, search "lid" in Settings or go to Control Panel → Power Options → Choose what closing the lid does and set it to Do nothing.
Method 3: powercfg Commands (Best for Scripting)
powercfg / PowerShell API
No install required · Scriptable · Good for automation workflows
Windows' powercfg utility modifies power plans from the command line. Run Command Prompt or PowerShell as Administrator.
Disable sleep via powercfg (permanent until reversed):
To restore defaults (30 minutes on AC, 10 minutes on battery):
Temporary override via PowerShell (lasts until the PowerShell window is closed):
Run this in an elevated PowerShell window. The lock releases when you press Enter or close the window. This is exactly what SmartSleep does under the hood — with a tray icon and toggle instead of a terminal window.
Diagnose what's causing unexpected sleep:
Method 4: PowerToys Awake (Overkill for Most)
Microsoft PowerToys — Awake module
20MB+ installer · Timed or indefinite modes · Made by Microsoft
PowerToys is a free Microsoft utility suite that includes a module called Awake specifically for preventing sleep. It supports timed durations (stay awake for 1 hour, 2 hours, etc.) and indefinite mode, with a small tray icon.
The functionality is identical to SmartSleep. The difference is the footprint: PowerToys is a full developer utility suite (keyboard remapper, window manager, color picker, file renamer, OCR tool, and about 20 other utilities). The installer is 20–25MB and installs background services for all modules, not just Awake.
If you already use PowerToys for other features, Awake is a good bonus. If you're installing PowerToys only to prevent sleep, you're installing an entire platform just to run one 2MB function. SmartSleep or the PowerShell method above does the same job.
Get it: learn.microsoft.com/en-us/windows/powertoys/ — free, from Microsoft.
Method 5: Caffeine / Don't Sleep (Third-Party Tray Apps)
Caffeine / Don't Sleep
Very small footprint · No installer needed for Caffeine · Long-standing freeware
Caffeine (by Zhorn Software) is a 92KB executable that simulates an F15 keypress every 59 seconds to prevent the screen saver and sleep from triggering. This is a hack rather than an API-level solution — it works by making Windows think there's keyboard activity, which is less clean than using the SetThreadExecutionState API but works on machines where that API is restricted by policy.
Don't Sleep (by SoftwareOK) uses the proper API approach, has a more detailed UI with scheduled modes, and is still actively maintained. It's a reasonable alternative to SmartSleep with a slightly more complex interface.
Both tools are legitimate freeware that have been around for over a decade. The main reason to choose SmartSleep over them is the Microsoft Store delivery model — automatic updates, signature verification, and no need to track third-party download pages for updates.
The Downsides of Keeping Your Machine Awake
Every guide on this topic stops at "how to do it." Few explain why you might not want to do it all the time.
- Battery drain on laptops. A laptop that never sleeps can't enter low-power states. Modern Windows sleep (S3 or Modern Standby) reduces power draw to under 1W. An awake machine draws 5–15W at idle. Over a day, this is the difference between a battery that's at 80% vs. 10%.
- Thermal impact. Modern CPUs throttle based on temperature. A machine that never cools down during idle periods runs warmer on average, which accelerates thermal aging of the CPU, memory, and storage over the long term.
- Display backlight aging. OLED and LCD backlight panels have finite lifetimes measured in hours. Keeping the display on around the clock uses those hours faster. For a secondary monitor this may be irrelevant; for a laptop display it matters more.
- Security posture. A machine that's always awake and logged in is exploitable whenever you're away from it. Sleep with lock-on-resume is a passive security layer. Removing it means relying entirely on other physical security controls.
These aren't reasons not to prevent sleep — they're reasons to prevent it intentionally and temporarily rather than permanently as a default.
Still Sleeping? How to Diagnose It
If you've changed your power settings and the machine is still sleeping, something else is overriding them. Common causes:
Group Policy override (work machines)
IT administrators can enforce power settings via Group Policy that override anything in the personal Settings UI. You'll see this when your settings appear correct but the machine still sleeps. Run rsop.msc (Resultant Set of Policy) and check the Computer Configuration → Administrative Templates → System → Power Management section. If there are configured policies, your IT department controls this — SmartSleep's API approach may still work since it signals at the session level rather than through the power plan.
Driver-triggered sleep
Some drivers (particularly older display drivers and network adapters configured for wake-on-LAN) can trigger sleep events independently. Run powercfg /lastwake in an elevated Command Prompt to see what triggered the most recent wake event, and powercfg /sleepstudy for a full event history.
Lid sensor (laptops)
If the laptop lid sensor is misbehaving or the lid is physically depressing the sensor slightly when closed, the system may interpret this as a lid-close event. Check Control Panel → Hardware and Sound → Power Options → Choose what closing the lid does and confirm it's set to Do nothing.
Modern Standby (S0 sleep)
Many modern laptops use S0 Modern Standby instead of traditional S3 sleep. In Modern Standby, the machine appears to be off but is actually in a low-power networked state — which can cause issues where the machine "wakes up" and performs background tasks. This is expected behavior, not a bug. Check which sleep state your machine supports: powercfg /a.
Frequently Asked Questions
How do I stop my Windows laptop from going to sleep?
The quickest way is Settings → System → Power & sleep → set "When plugged in, PC goes to sleep after" to Never. For a temporary solution without permanently changing settings, use Vexifa SmartSleep (free, system tray app from the Microsoft Store) or run powercfg /requests to diagnose what's overriding your settings.
Is it bad to keep your laptop awake all the time?
For laptops, permanently disabling sleep has real downsides: the battery drains faster on battery power, the machine runs hotter, and the display backlight ages faster. For desktops, the concern is mainly energy waste. A better approach is to disable sleep only when you need to — during a presentation, download, or long-running process — and let the machine sleep normally the rest of the time. Tools like SmartSleep are designed for this: they prevent sleep while active and restore your normal settings when dismissed.
What is the powercfg command to prevent sleep?
Run powercfg /change standby-timeout-ac 0 in an elevated Command Prompt to disable sleep on AC power. Use powercfg /change standby-timeout-dc 0 for battery. To restore defaults, replace 0 with 30 (minutes). For a temporary session-scoped approach without changing settings, use the PowerShell SetThreadExecutionState method described above.
Does PowerToys Awake prevent sleep on Windows?
Yes, PowerToys Awake is a built-in PowerToys utility that prevents Windows from sleeping. It supports timed durations and indefinite mode. The downside is that PowerToys is a 20MB+ suite installation — you're installing an entire collection of developer utilities just to get one sleep-prevention feature. If you only need the sleep prevention, Vexifa SmartSleep is a smaller dedicated app that does the same job without the overhead.
Why does my Windows laptop keep sleeping even after I change power settings?
Three common causes: (1) A Group Policy override set by IT administration on a work machine — these override personal power settings. Run rsop.msc to check. (2) A driver or system service is triggering sleep independently. Run powercfg /sleepstudy to see a full event log. (3) The laptop lid sensor is triggering a lid-close sleep event — check Control Panel → Power Options → Choose what closing the lid does.