winrar 命令行 示例_如何使用关闭命令示例和教程从命令行关闭Windows

winrar 命令行 示例

winrar 命令行 示例

Windows operating systems provide the commandshutdown which has a lot of functions like a reboot, shutdown, logoff, etc. In this tutorial, we will look most useful of them. Windows XP is a very old operating system where it may lack some of the options and features described here. We will use tocmd.exe run from CLI.

Windows操作系统提供了命令shutdown ,该命令具有许多功能,例如重新启动,关闭,注销等。在本教程中,我们将在其中最有用。 Windows XP是一个非常古老的操作系统,可能缺少此处介绍的某些选项和功能。 我们将使用从CLI运行cmd.exe

句法 (Syntax)

shutdown command syntax is like below.

shutdown命令的语法如下所示。

shutdown OPTIONS COMPUTER COMMENT
  • OPTIONS is used for different types of options like restart, logoff, etc.

    OPTIONS用于不同类型的选项,例如重新启动,注销等。

  • COMPUTER is used when we need to run shutdown command on the remote computer

    需要在远程计算机上运行shutdown命令时使用COMPUTER
  • COMMENT is used with comment feature to provide a message.

    COMMENT与注释功能一起使用以提供消息。

关机命令的打印帮助 (Print Help For Shutdown Command)

Help information about the shutdown command can be listed with the /? options. This will list all available options and short description about the options.

可以使用/?列出有关shutdown命令的帮助信息。 选项。 这将列出所有可用的选项以及有关这些选项的简短说明。

>  shutdown /?
Print Help For Shutdown Command
关机命令的打印帮助

关机系统(Shutdown System)

Now the main purpose of the shutdown command is shutting down the system or computer. Just providing the command is not enough to power off the computer. We should provide the option /s in order to shut down the system.

现在,shutdown命令的主要目的是关闭系统或计算机。 仅提供命令不足以关闭计算机电源。 我们应该提供选项/ s来关闭系统。

> shutdown /s
Shutdown System
关机系统

The shutdown command will not shutdown the computer immediately. It will take about 1 minute to complete shutdown. Before the shutdown the current user session will be closed properly to prevent data loss.

shutdown命令不会立即关闭计算机。 完成关机大约需要1分钟。 在关闭之前,当前用户会话将被正确关闭,以防止数据丢失。

重启系统 (Restart System)

We can also restart the system with the commandshutdown. We will provide the option /r in order to restart the system or computer. This will shut down and restart the computer.

我们还可以使用shutdown命令重新启动系统。 我们将提供选项/ r以便重新启动系统或计算机。 这将关闭并重新启动计算机。

> shutdown /r

从当前GUI会话注销 (Logout From Current GUI Session)

If we have logged in with the GUI we may need to log out from the current session. We will use the option /l in order to log out from the current user session.

如果我们已经使用GUI登录,则可能需要从当前会话中注销。 我们将使用选项/l以便从当前用户会话中注销。

> shutdown /l

中止/取消系统关机 (Abort/Cancel System Shutdown)

By default when we issue shutdown command the computer will not shut down immediately. There are 60 seconds wait time before shutdown. We can cancel the shutdown operation with which/a means abort.

默认情况下,当我们发出shutdown命令时,计算机不会立即关闭。 关机前有60秒的等待时间。 我们可以取消/a表示中止的关闭操作。

> shutdown /a
Abort System Shutdown
中止系统关机

Then the shutdown is cancelled we may see a message like “Logoff Cancelled” in the bottom right corner of the screen.

然后取消关闭,我们可能会在屏幕的右下角看到类似“注销已取消”的消息。

LEARN MORE  How To Logoff From Command Line In Windows?
了解更多如何在Windows中从命令行注销?

Hibernate系统 (Hibernate System)

Hibernate features will make computer sleep and wake up in seconds without starting from scratch. We can hibernate the computer with the option/h like below.

Hibernate功能将使计算机在数秒内进入睡眠和唤醒状态,而无需从头开始。 我们可以使用/h选项使计算机Hibernate,如下所示。

> shutdown /h

If the hibernation is not enabled we may see an error like “Hibernation is not enabled on this system. You must enable hibernation in order to use the -h option.(126)”. So we should enable hibernation from “Power” options.

如果未启用Hibernate方式,我们可能会看到类似“此系统未启用Hibernate方式”的错误。 您必须启用Hibernate模式才能使用-h选项。(126)”。 因此,我们应该从“电源”选项启用Hibernate模式。

Hibernate System Error
Hibernate系统错误

向系统用户发送消息(Send Message To System Users)

A typical server will be used more than one person. There may be other persons who are using server currently. We need to provide information about a shutdown, restart. We can use the option/c with the message. The message will be put into double quotes.

一台典型的服务器将使用多个人。 当前可能还有其他人正在使用服务器。 我们需要提供有关关机,重启的信息。 我们可以在消息中使用选项/c 。 该消息将置于双引号中。

> shutdown /s /c "The system will be shut down in 60 seconds."

指定关机和重新启动的时间或间隔 (Specify Time or Interval For  Shutdown and Restart)

Default shutdown interval or time may be enough for us or other computer and system users. We can specify the interval we need with the option/t and time value. In this example, we will specify a waiting time for 120 seconds for the shutdown. Merging this option with send message will be very useful.

对于我们或其他计算机和系统用户,默认关闭间隔或时间可能足够。 我们可以使用选项/t和时间值指定所需的间隔。 在此示例中,我们将为关闭指定等待时间120秒。 将此选项与发送消息合并将非常有用。

> shutdown /s /t 120 /c "Shutdown in 120 seconds"

显示关机GUI (Show Shutdown GUI)

shutdown command provides a very useful GUI or dialog box. In order to open GUI for shutdown command, we will provide the “/i” option. This dialog box is named “Remote Shutdown Dialog” which is mainly designed to shut down or reboot the remote systems. But we can also use it for the local system too. But keep in mind that this must be first option for the shutdown command.

shutdown命令提供了非常有用的GUI或对话框。 为了打开用于关闭命令的GUI,我们将提供“ / i”选项。 该对话框名为“ Remote Shutdown对话框”,主要用于关闭或重新引导远程系统。 但是我们也可以将其用于本地系统。 但是请记住,这必须是shutdown命令的首选。

Show Shutdown GUI
显示关机GUI

Here we can use the “localhost” for the Computers list. Also the “Comment” can not be empty in order to complete shutdown or reboot operation.

在这里,我们可以在“计算机”列表中使用“ localhost ”。 此外,“ Comment ”(注释)不能为空,以完成关闭或重新启动操作。

立即关闭而不发出警告 (Immediately Shutdown without a Warning )

By default, the shutdown operation will have some time-out and warning for the users. But this takes some time for about 40 seconds. We can skip this waiting time and immediately shut down the system without a warning with the option /p.

默认情况下,关闭操作会给用户一些超时和警告。 但这需要一些时间,大约需要40秒。 我们可以跳过此等待时间,并使用/ p选项立即关闭系统,而不会发出警告。

>  shutdown /p

.

翻译自: https://www.poftut.com/shutdown-cmd-windows-command-line-shutdown-command-examples-tutorial/

winrar 命令行 示例

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值