Every Windows PC includes powercfg, a command-line tool for power settings. It does everything the Settings app does, faster, and a few things the Settings app can't, like showing exactly which program is stopping your PC from sleeping.
Open Terminal or Command Prompt to use it. Some commands need it to be run as administrator: right-click and choose Run as administrator.
Change sleep and screen timeouts
The /change option sets a timeout in minutes. -ac means plugged in, -dc means on battery, and 0 means never.
powercfg /change standby-timeout-ac 0stops the PC sleeping while plugged in.powercfg /change standby-timeout-dc 30sleeps after 30 minutes on battery.powercfg /change monitor-timeout-ac 20turns the screen off after 20 minutes when plugged in.powercfg /change hibernate-timeout-ac 0disables hibernation on a timer while plugged in.
These change your current power plan, and they stay changed until you change them back. Write down your old values first, or check them in Settings > System > Power & battery.
Find out what's keeping your PC awake
This is the most useful command on the list. Run it as administrator:
powercfg /requests
It lists every current request to keep the display or system on, grouped under headings like DISPLAY, SYSTEM and EXECUTION. A video player, a download manager, a browser tab that's asked to keep the screen on, or a driver can all show up here. If your PC won't sleep at night, the culprit is usually in this list.
Find out what woke it up
powercfg /lastwakeshows what woke the PC most recently.powercfg /waketimerslists scheduled tasks that are allowed to wake it, such as updates and maintenance.powercfg /devicequery wake_armedlists devices that can wake it, often a mouse or network adapter.
Get a battery report
powercfg /batteryreport saves an HTML report showing your battery's design capacity, its current full charge, and recent usage. It's handy before deciding whether keeping a laptop awake all afternoon is a good idea.
What powercfg can't change
On a work PC, IT often sets power and lock-screen rules with Group Policy or device management. Those rules win, and they may reset your changes. Sleep is also separate from the lock screen and from your status in Teams or Slack: a PC that never sleeps can still lock after a few minutes and still show you as Away.
When you only need things kept awake for one long job, a temporary tool is tidier than changing your power plan. Windows Mouse Mover holds a screen wake lock while it's on, which you'll see listed under powercfg /requests, and releases it the moment you switch it off. Your settings stay exactly as they were.