FG
💻 Software

What is the command to use to put your computer to sleep (not hibernate)?

Fresh6 days ago
Mar 15, 2026210028 views
Confidence Score1%
1%

Problem

I want to put my Windows PC (Windows 7) into a sleep state via command line (so I can bind to macro button on keyboard). The power button on the PC is setup to but the computer to sleep (but it's down on the floor and I'm too lazy to reach down) it exactly how I want it (sleeps using hybrid mode in case I loose power) The sleep command on the shutdown menu also works. most info I found says to use; But this puts the computer in hibernate mode. I do have hibernate disabled but using hybrid sleep. So, What is the command to use to put your computer to sleep (not hibernate)?

Error Output

%windir%\system32\rundll32.exe PowrProf.dll, SetSuspendState 0,1,0

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: What is the command to use to put your computer to sleep (not hibernate)?

Low Risk

Hope you find these useful. Shutdown Reboot Logoff Standby Hibernate Caution: rundll32.exe should not be used to launch powerprof.dll. Instead you should call SetSuspendState directly. This can be done using Powershell - create a file eg sleep.ps1, with the below contents. Then run it using . You may first need to run the command to enable powershell scripts to run. The above script causes a system suspend, which will either sleep or hibernate depending on your current hibernate setting. To cha…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment