The easiest way is to directly
There is a [sleep] key in the rightmost three keys in the first row of the keyboard. [Weakup] The shutdown is [power] three keys are together
Method 1:
To use Windows ' own commands, first turn off hibernation, or you can only go to hibernation
Powercfg-hibernate off
And then the following command sleep
The code is as follows |
Copy Code |
Rundll32.exe Powrprof.dll,setsuspendstate Sleep |
But some netizens are dormant after they are asleep, because when sleep and hibernation are present, they perform hibernation, and when you turn off hibernation, you turn on sleep. As a result, we only need 3 batch files to achieve a key to sleep when hibernation is open.
Windowssleep.bat delay Sleep main file, "powercfg/h off" is off Hibernate, "Ping 0.0.0.0-n 30" delay suspend (30 is delay time, can be adjusted), "Rundll32.exe Powrprof.dll,set Suspendstate sleep "into slumber.
The code is as follows |
Copy Code |
@echo off powercfg/h off Ping 0.0.0.0-n 30 rundll32.exe Powrprof.dll,setsuspendstate Sleep
|
Windowshibernate.bat sleeps after sleep (only gives hibernation, not hibernation), and 80 of the "powercfg/h/size 80" is the percentage of memory that is occupied by the hibernation file (which is stored in the system partition root) and can be adjusted.
The code is as follows |
Copy Code |
@echo off powercfg/h/size 80 |
Delayed sleep. VBS runs the above two batch files in the background and does not eject the window. Put these three files in the same folder, we usually perform delayed sleep. VBS implements one-click Delay sleep (or creates a new shortcut to it on the desktop).
The code is as follows |
Copy Code |
DIM Objshell Set Objshell=wscript.createobject ("Wscript.Shell") Ireturn=objshell.run ("cmd.exe/c Windowssleep.bat", 0, TRUE) Ireturn=objshell.run ("cmd.exe/c Windowshibernate.bat", 0, TRUE) |
Method 2:
Directly on the Microsoft official website next software PsShutdown.exe, can Baidu to download
Then enter in the Unpacked folder at the command line (run cmd): psshutdown.exe-d-T 0
Input Psshutdown.exe can display Help