Stop Your PC from Sleeping Without Unplugging It

Your PC goes to sleep to save power and reduce wear on the display and hard drive. You can override this behavior in Windows settings without changing your hardware. The method depends on whether you want to prevent sleep only while you're using the computer, or keep it awake even when you step away.

The fastest route is the Power & Sleep settings in Windows, where you can set the sleep timer to "Never" for both plugged-in and battery power. If you need the computer to stay awake for a specific task—downloading a large file, rendering video, or running a backup—you can use a built-in tool called caffeine mode or adjust individual program settings instead of changing your system defaults.

Key Takeaways

  • Open Settings, select System, then Power & Sleep to change when your PC goes to sleep; set the timer to "Never" if you want it to stay awake indefinitely.
  • Windows has a built-in "Use Caffeine" feature (in some versions) that keeps your PC awake for a set time without permanently changing sleep settings.
  • You can prevent sleep only while a specific program is running by adjusting that program's power settings in Task Scheduler or through its own preferences.
  • Plugged-in PCs and battery-powered laptops have separate sleep timers, so you may need to adjust both if you use your device in different ways.
  • Moving your mouse or pressing a key will wake your PC if it has already gone to sleep, but changing the sleep timer prevents it from sleeping in the first place.

Change Sleep Settings in Windows Settings

Open the Windows Settings app by pressing Windows key + I. Click System in the left sidebar, then select Power & Sleep. You will see two sections: one for when your PC is plugged in, and one for when it is on battery power.

Under Screen, you can set how long the display stays on before turning off. Under Sleep, you can set how long the PC waits before going to sleep. Click the dropdown next to Sleep and select Never if you want your PC to never sleep automatically. If you only want to extend the time before sleep, choose 10 minutes, 30 minutes, 1 hour, or another interval from the list.

If you are using a laptop on battery power, repeat this step for the battery section. Many people set a short sleep timer for battery mode (to preserve charge) but set it to "Never" when plugged in. Once you close Settings, the change takes effect when ready.

Use Caffeine Mode for Temporary Wake Time

Windows 11 includes a feature called Caffeine that temporarily prevents sleep without permanently changing your settings. Press Windows key + A to open Quick Settings, then look for Caffeine in the expanded menu. Click it to turn it on, and your PC will stay awake for one hour. When the hour is up, your normal sleep settings take over again.

If you do not see Caffeine in your Quick Settings menu, you may be using Windows 10 or an older version of Windows 11. In that case, you can read the free Caffeine app from the Microsoft Store, which provides the same function. Open the Microsoft Store app, search for "Caffeine," and install the official Microsoft version.

This method is useful when you need your PC awake for a specific task—uploading files, installing updates, or waiting for a read to finish—but you do not want to change your permanent sleep settings. Once you are done, Caffeine turns off automatically and your PC returns to its normal schedule.

Prevent Sleep While a Specific Program Runs

If you want your PC to stay awake only while a particular program is running—such as a video editor, file transfer tool, or backup software—you can configure that program to prevent sleep. Right-click the program's shortcut or the .exe file and select Properties. Click the Advanced button, then check the box next to Run with full CPU priority if available. Some programs have their own power settings; check the program's preferences or settings menu for an option like "Prevent system sleep" or "Keep display on."

Alternatively, you can use Task Scheduler to run a program with a wake-lock. Press Windows key + R, type taskschd.msc, and press Enter. Click Create Task on the right side. Under the General tab, check Run whether user is logged in or not and Do not store password. Go to the Conditions tab and uncheck Allow the task to be removed and Start the task only if the computer is on AC power. This tells Windows to keep the PC awake while the task runs.

Adjust Display Sleep Separately from PC Sleep

Your PC has two separate sleep timers: one for the display and one for the computer itself. The display can turn off after 5 minutes while the PC stays awake, or vice versa. In Power & Sleep settings, the Screen dropdown controls when the display turns off, and the Sleep dropdown controls when the PC enters sleep mode.

If you want your display to turn off to save power but your PC to keep running—useful if you are downloading files or running background tasks—set Screen to a short time like 5 or 10 minutes, and set Sleep to "Never." The display will go dark, but your PC will continue working. You can wake the display by moving your mouse or pressing a key.

Use Command Line to Prevent Sleep Temporarily

If you are comfortable using the command prompt, you can prevent sleep with a single command. Press Windows key + R, type cmd, and press Enter. Type the following command and press Enter:

powercfg /change monitor-timeout-ac 0

This sets the monitor timeout to never turn off while plugged in. To prevent the PC itself from sleeping, type:

powercfg /change standby-timeout-ac 0

Replace "ac" with "battery" if you are on a laptop running on battery power. To revert these changes, replace the "0" with the number of minutes you want (for example, "10" for 10 minutes). This method is faster than navigating menus if you make frequent changes, but the Settings app method is easier if you are not familiar with the command prompt.

Common Mistakes to Avoid

Do not set sleep to "Never" permanently if you are trying to save power or reduce electricity use. Leaving your PC awake 24/7 uses significantly more energy than letting it sleep. Set it to "Never" only when you have a specific reason, and return it to a shorter timer when you are done.

If you have a laptop, remember that battery and plugged-in settings are separate. You may set sleep to "Never" when plugged in but forget to adjust the battery setting, which means your laptop will still sleep quickly when unplugged. Check both sections in Power & Sleep settings if your PC behaves differently depending on power source.

Do not confuse the display sleep timer with the PC sleep timer. If your screen keeps turning off even though you set the PC to never sleep, you need to adjust the Screen setting, not the Sleep setting. These are two different timers and both can be set independently.

Frequently Asked Questions

Will keeping my PC awake damage it?

No, but it uses more electricity and generates more heat. Modern PCs are designed to run continuously. If you keep your PC awake, make sure the fan vents are not blocked and the room temperature is reasonable. Return the sleep timer to a normal setting when you no longer need the PC awake.

Why does my PC still go to sleep even after I set it to Never?

Check whether a program or task is overriding your settings. Some antivirus software, backup tools, and games have their own power management. Also verify that you changed the correct setting—plugged-in PCs and battery-powered laptops have separate timers. If you are on battery, the battery setting may still be set to sleep.

Can I set different sleep times for different users on the same PC?

Yes. Each user account has its own Power & Sleep settings. Log in as a different user, open Settings, and adjust Power & Sleep for that account. The settings will explore only when that user is logged in.

What is the difference between sleep and hibernation?

Sleep keeps your PC in a low-power state with RAM still powered, so it wakes up in seconds. Hibernation saves everything to the hard drive and powers off completely, using almost no electricity but taking longer to wake. You can enable hibernation in Advanced Power Options if you want that choice.

Does closing the laptop lid put it to sleep?

Yes, by default. You can change this in Power & Sleep settings. Scroll down to Power button and lid and click Additional power settings. Select Choose what closing the lid does and change the setting from "Sleep" to "Do nothing" if you want the laptop to stay awake when closed.