How Windows computer sets up system sleep

Source: Internet
Author: User
Tags sleep first row

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.