Windows operating system is GUI based but provides some commands for administrative jobs. logoff
command is one of them and used with the command line. The logoff command has very few options and features. We will look at these usage types of logoff command below.
Windows操作系统基于GUI,但提供了一些用于管理作业的命令。 logoff
命令是其中之一,并与命令行一起使用。 注销命令具有很少的选项和功能。 我们将在下面查看注销命令的这些用法类型。
注销命令帮助 (logoff Command Help)
Help about logoff command can be listed with /?
option like below.
可以使用/?
列出有关注销命令的帮助/?
如下所示的选项。
$ logoff /?

注销命令用法(Logoff Command Usage)
We can use logoff command without providing any option or parameter. This will logoff current session.
我们可以使用logoff命令,而无需提供任何选项或参数。 这将注销当前会话。
$ logoff
注销会话ID或名称 (Logoff With Session ID or Name)
On a computer, there may be more than one session. One of the sessions can be specified to log off. How can we specify the session name? Like below. In this example, we specify session-id 2 to log off.
在计算机上,可能有多个会话。 可以指定会话之一以注销。 我们如何指定会话名称? 像下面。 在此示例中,我们指定会话ID 2以注销。
$ logoff 2
注销时打印动作 (Print Actions While Logoff)
Verbose information about the logoff action can be printed with the /v
option.
可以使用/v
选项打印有关注销操作的详细信息。
$ logoff /V
远程计算机中的注销会话 (Logoff Session In the Remote Computer)
Another useful feature of the logoff command is logoff remote system. We will provide the remote system IP address or domain name after the command like below.
logoff命令的另一个有用功能是注销远程系统。 我们将在如下命令之后提供远程系统IP地址或域名。
$ logoff \\myserver