命令提示符关机命令

命令提示符关机命令

设置

我正在运行一台 Windows 7 PC 和一台 Windows 7 笔记本电脑,它们都连接到路由器,形成一个 LAN。因此,我想从 PC 远程关闭笔记本电脑。我发现我可以在命令提示符通过输入:shutdown -ishutdown/i。然后我在出现的 GUI 中单击“添加”,并输入笔记本电脑的 IP 地址。

问题

但是,它没有起作用,而是给了我这个错误:

The entered computer name is not valid or remote shutdown is not supported on the target computer. Check the name and then tryp again or contact your system administrator.<53>

我在两台电脑上启用并启动了远程注册表,但仍然不起作用。我是两台电脑的管理员用户,并使用管理员帐户登录桌面。有什么想法吗?

答案1

您是否使用了在两台计算机上都具有管理员权限的域帐户?如果是,则 computer1 上的以下命令将在 computer2 上运行:
shutdown /m computer2 /s /t 00

您可能需要检查防火墙是否在第二台计算机上运行,​​并验证是否有必要的例外:

“要关闭或重新启动远程计算机,必须在远程计算机上启用远程管理和 Windows 管理规范防火墙例外。”

答案2

当我想关闭计算机时,我会在遥控器上打开命令提示符,然后输入

shutdown /s /t 10

该命令将在 10 秒内关闭计算机,以下是关机命令的命令开关

To shutdown your PC type : shutdown / s

To restart your PC type : shutdown / r

To logoff your PC type : shutdown / l

The list of shutdown options include:

No args        Display help. This is the same as typing /?.
/?              Display help. This is the same as not typing any options.
/i              Display the graphical user interface (GUI).  This must be the first option.
/l              Log off. This cannot be used with /m or /d options.
/s             Shutdown the computer.
/r             Full shutdown and restart the computer.
/g             Full shutdown and restart the computer. After the system is rebooted, restart any registered applications.
/a              Abort a system shutdown.  This can only be used during the time-out period.
/p             Turn off the local computer with no time-out or warning. Can be used with /d and /f options.
/h             Hibernate the local computer. Can be used with the /f option.
/hybrid    Performs a shutdown of the computer and prepares it for fast startup. Must be used with /s option.
/e              Document the reason for an unexpected shutdown of a computer.
/o             Go to the advanced boot options menu and restart the computer.
/t xxx      Set the time-out period before shutdown to xxx seconds. The valid range is 0-315360000 (10 years), with a default of 30.
/c             Comment on the reason for the restart or shutdown. Maximum of 512 characters allowed.
/f             Force running applications to close without forewarning users.
/d            Provide the reason for the restart or shutdown.

相关内容