我浏览了许多论坛和参考页面,了解如何在没有指定睡眠按钮的计算机上创建睡眠快捷方式。我发现要创建有效的睡眠快捷方式,您必须禁用休眠模式。如果可能的话,我打算同时使用这两种方式。
我正在使用在 Windows 10 上运行该命令的文件的快捷方式:
C:\Windows\System32\rundll32.exe powrprof.dll,SetSuspendState 0,1,0
启用休眠后,该命令将使计算机进入休眠状态,而不是睡眠状态。我希望我的电源按钮使计算机进入休眠状态,而热键使计算机进入睡眠模式。
有没有可能在启用休眠模式的同时创建 Windows 10 上的热键快捷方式以进入睡眠状态? 有什么方法可以防止计算机每次运行时询问我是否允许文件进行更改?
答案1
有没有可能的方法可以在 Windows 10 上创建热键快捷方式来进入睡眠状态
让快捷方式运行以下批处理文件:
@echo off
psshutdown -d
exit
-d
暂停计算机。
关机
您可以使用 PsShutdown 启动本地或远程计算机的关机、注销用户、锁定系统或中止即将关机。
Usage: psshutdown [[\\computer[,computer[,..] | @file [-u user [-p psswd]]] -s|-r|-h|-d|-k|-a|-l|-o [-f] [-c] [-t nn|h:m] [-n s] [-v nn] [-e [u|p]:xx:yy] [-m "message"]
- Displays the supported options.
computer Perform the command on the remote computer or computers specified. If you omit the computer name the command runs on the local system, and if you specify a wildcard (\\*), the command runs on all computers in the current domain.
@file Run the command on each computer listed in the text file specified.
-u Specifies optional user name for login to remote computer.
-p Specifies optional password for user name. If you omit this you will be prompted to enter a hidden password.
-a Aborts a shutdown (only possible while a countdown is in progress).
-c Allows the shutdown to be aborted by the interactive user.
-d Suspend the computer.
-e Shutdown reason code.
Specify 'u' for user reason codes and 'p' for planned shutdown reason codes.
xx is the major reason code (must be less than 256).
yy is the minor reason code (must be less than 65536).
-f Forces all running applications to exit during the shutdown instead of giving them a chance to gracefully save their data.
-h Hibernate the computer.
-k Poweroff the computer (reboot if poweroff is not supported).
-l Lock the computer.
-m This option lets you specify a message to display to logged-on users when a shutdown countdown commences.
-n Specifies timeout in seconds connecting to remote computers.
-o Logoff the console user.
-r Reboot after shutdown.
-s Shutdown without power off.
-t Specifies the countdown in seconds until the shutdown (default: 20 seconds) or the time of shutdown (in 24 hour notation).
-v Display message for the specified number of seconds before the shutdown. If you omit this parameter the shutdown notification dialog displays and specifying a value of 0 results in no dialog.
免责声明
我不隶属于Windows 系统内部无论如何,我只是他们软件的最终用户。