2

I often need to quickly put my Windows 10 computer to sleep in my shared office at work, so what is a keyboard shortcut to put the computer to sleep? Ideally, I want a built-in shortcut, or one that can be configured with native Microsoft Windows features without installing any third-party applications.

Virtually the same question has already been asked (What is the hotkey to put my Windows to sleep?), but that poster accepted an answer that involved 3rd-party software, which I would prefer to avoid (less crud on my systems). Moreover, some answers involved a long series of up and down and backwards arrow keys (kind of like a video game cheat code), which is not my idea of a keyboard shortcut, especially when the sequence varies depending on a computer's particular configuration (e.g. works on my desktop with hibernation disabled, but not on my laptop where the hibernation option requires memorizing a different sequence).

Since it seems that Microsoft doesn't offer a built-in shortcut, could someone please perhaps explain how to create one for sleep without 3rd party tools?

Tripartio
  • 650

3 Answers3

2

The following command will immediately send Windows to hibernation, so long as that is enabled (it is recommended against using hibernation for machines with the OS on an SSD).

shutdown -h

Alternatively, here is a post with the same question and more options: How can I put the computer to sleep from Command Prompt/Run menu?

MikeC
  • 137
1

Using @MikeC answer:

  • create a file named, for example soft-shutdown.bat wherever you want.
  • open this file and paste shutdown -h in it. (right click on the file, and choose Edit, and then paste)
  • right click on the it, and Create Shortcut
  • right click on the shortcut, select properties
  • in the shortcut key field, press the combination you want.

I'm not aware of how to bind a shortcut to run a file, I just know how to bind a shortcut to a shortcut file, which is bounded to a file.

math2001
  • 111
  • 4
1

Create a new shortcut in a safe location: Right-click > New > Shortcut.

For the location of the item enter: %windir%\System32\shutdown.exe -s -t 00

That's the Shutdown program, followed by the Sleep argument, and the Time Zero Seconds argument which means it'll happen right away.

Click Next.

Change the name of the shortcut if you wish and click Finish.

Right-click on the newly created shortcut and click in the Shortcut key: field.

All Shortcut Keys begin with CTRL-ALT, so just tap the SINGLE letter you want the Shortcut Key to end with. For instance, tap "S" and your keyboard shortcut will be CTRL-ALT-S.

Using this shortcut key should now put your computer to sleep right away.

UPDATE: I was wrong on the shutdown arguments

As Ochado pointed out, shutdown -s shuts the computer down, which is entirely NOT what they wanted.

The shutdown command does not actually have an argument to sleep the computer. Hibernate is more of a combination of shutdown and sleep.

To actually sleep the computer using a command which can be put into a shortcut and assigned a keyboard command, you have to disable hibernation, and then use a different set of commands.

First, disable hibernate by running powercfg -hibernate off

Now, create a shortcut as I specify above, but use the command rundll32.exe powrprof.dll,SetSuspendState 0,1,0 instead of the shutdown command previously (erroneously) specified.

Now follow the rest of the steps in the above section to create a keyboard shortcut for this.

music2myear
  • 49,799