How to use the remote shutdown command in Windows如何使用远程关机命令在Windows

Posted on May 26, 2008 at 5:31 am张贴于2008年5月26日在上午05时31分

This article will show you how to use the remote shutdown command tool in Windows to remotely shut down, restart, or logoff a local or networked computer.本文将向您展示如何使用远程关机命令的工具,在Windows远程关机,重新启动或注销本地或网路连线的电脑。 This can be very useful sometimes if you have multiple computers at home or on your network that you want to quickly shutdown or restart.这可以非常有用,有时如果您有多个电脑在家里或在您的网络上,你想要快速关机或重新启动。

You can perform a remote shutdown from the command prompt using the shutdown command and it’s associated switches, from the remote shutdown dialog box, or from a batch file.您可以执行远程关机从命令提示符使用shutdown命令和它相关的开关,从远程关机对话框中,或从一个批处理文件。 I’ll try to go through all three in this guide.我会尝试去通过所有这三个在本指南。

Remote Shutdown Overview远程关机概述

Firstly, in order to remotely shutdown a computer on your network, you’ll need to make sure you have Administrative access to that computer.首先,为了远程关机您网路上的电脑,您需要确保您有管理权限的计算机。 If you’re on a home network, the best way to do this is to make sure all computers are in the same workgroup and that they all have at least one Administrator account with the same user name and password.如果您对家庭网络,最好的方法做这是为了确保所有计算机都在同一工作组和他们都至少有一个管理员帐户具有相同的用户名和密码。

You can also have different Administrator account names across computers, but then you’ll need to make sure you add the Administrator account of one computer to the account list on the other computers.您也可以有不同的管理员帐户的名称多台电脑,但接着,您需要确保您添加管理员帐户的一台计算机的帐户名单上的其他电脑。 You’ll also need to know all the names of the other computers on the network.您还需要知道所有的姓名,该网络上的其他计算机。 You can do that by going to Control Panel and then clicking on System .你可以这样做,去控制面板 ,然后点击系统 Then click on the Computer Name tab.然后按一下计算机名称选项卡。

计算机名称

Remote shutdown is useful for managing multiple computers at once and especially useful for helpdesk technicians when they have to fix remote computers.远程关机是有用的管理多台计算机在一次特别有用求助技术员当他们有固定的远程计算机。

Remote shutdown via Command Prompt远程关机通过命令提示符

The shutdown command is most flexible when using it from the command prompt because you can add a bunch of switches to it, which allow you to customize the behavior. shutdown命令是最灵活的,当用它从命令提示符,因为您可以添加一群切换到它,这可让您自订的行为。 Go to Start , then Run , and type in CMD .转到开始 ,然后运行 ,并键入在cmd In the black command window, type in shutdown /? to see the list of switches.在黑色命令窗口中,键入在关机/ ?看到名单开关。

shutdown命令

You have to use at least one switch in order for the command to do anything.你必须至少使用一个开关,以便为命令做任何事情。 Basically you would type in shutdown -X -Y -Z where X, Y, Z are letters in the list above.基本上您可以在其中输入在关机的X - Y - Z的情况下的X , Y , z是信在上述清单。

Here are a couple of the most command switches and what actions they peform:这里有一对夫妇的最指挥开关和采取何种行动,他们peform :

-l: Logs off the computer -升:注销计算机

-s: Shuts down the computer - S的:在电脑关机

-r: Restarts the computer - R的:重新启动计算机

-m -米 \\computername \ \计算机 : remote shutdown of a computer :远程关机的电脑

-f: Forces programs to close immediately - F :在部队的计划立即关闭

So for remotely shutting down another machine on your network, you would type into the command prompt the following commands:因此,远程关停另一台机器在您的网路上,您可以在其中输入到命令提示符以下命令:

shutdown –m \\computername –r –f 关机米\ \计算机- R的- F的

This above command will restart the computer named computername and force all programs that are still running to die.这上述命令将重新启动电脑,命名为计算机和部队的所有程序仍在运行死亡。

shutdown –m \\computername –r –f –c “The computer will restart, please save all work.” –t 60 关机米\ \计算机-的R -的F - C “的计算机将重新启动,请保存所有工作” 。 - 60吨

This command will restart the computer named computername , force all programs that are running to die, show a message to the user, and countdown 60 seconds before it restarts.此命令将重新启动电脑,命名为计算机 ,迫使正在运行的所有程序,以模具,显示讯息给使用者,倒数60秒,才重新启动。

Remote Shutdown via Shutdown Dialog远程关机通过关机对话框

If you don’t like all those switches, etc, or using the command prompt, then you can bring up the shutdown dialog box.如果你不喜欢所有这些开关等,或使用命令提示符下,那么你就可以带出关机对话框中。 You can open the dialog window by clicking Start, click Run, type CMD and typing shutdown -i and in the blank DOS window.您可以打开对话窗口单击开始,单击运行,键入cmd和打字关机,我和在空白DOS窗口。

关机i

A window similar to the one below will appear:一个窗口,一个类似下面会出现:

远程关机对话框

Click the Add or Browse button to add computers to the list.单击添加或浏览按钮来添加电脑到清单中。 You can then run the commands on the entire batch of computers.然后,您就可以执行命令,对整个一批电脑。 If you click Add, you’ll need to enter in the network name of the computer in the format如果您单击添加,您需要输入在网络中的计算机的名称,在格式 \\computername \ \计算机 . You can even add your own computer to test it out and make sure it works.您甚至可以添加您自己的电脑上测试出来,并确保工程。

计算机名称[ 6 ]

Of course, you need to know the actual computer name, which I mentioned how you can figure out above.当然,您需要知道实际的计算机名称,我刚才提及的如何,您可以计算出以上。 You’ll also need Administrative access.您还需要管理权限的。 You can determine this by going to My Computer and typing您可以判断这是由去我的电脑和打字 \\computername \ \计算机 into the address bar and seeing if you can get access without having to be prompted for a password.在地址栏看到,如果您可以获取而不被提示输入密码。

我的计算名称

So add as many computers to the list as you like and then set your options.因此,新增许多电脑名单如你所愿,然后设定您的选项。 You can shutdown, restart, or logoff.您可以关机,重新启动或注销。 You can also display a warning for however many seconds you like.您也可以显示一个警告,但许多秒你喜欢。 You can type in a comment at the bottom which will be displayed to users.您可以输入评论在底部将显示给用户。 That’s it!这样就大功告成了!

Remote Shutdown via Batch File远程关机通过批处理文件

Finally, you can create a batch file so that you can do all of this by just clicking on a file!最后,您可以创建一个批处理文件,这样您可以做的这一切,只要点击一个文件! Or you can even schedule the batch file to be run at specific intervals using Windows Scheduler.或您甚至可以如期批处理文件来运行在特定的时间间隔使用Windows调度程序。

Just go to Notepad and type in the commands you would have typed into the command prompt:只要到记事本在类型和命令,您将输入的命令提示符:

shutdown –m 关机米 \\computername1 \ \ computername1 –r - R的
shutdown –m 关机米 \\computername2 \ \ computername2 –r - R的
shutdown –m 关机米 \\computername3 \ \ computername3 –r - R的

This will restart three computers on my home network.这将重新启动三台电脑对我的家庭网络。 You would of course replace computername1 with the actual names of your computers.你当然会取代computername1与实际的名称,您的计算机。 Then simple save the file with a .BAT file extension.然后简单的档案储存与一。 bat文件扩展名。 You can put as many commands into the batch file as you like, so feel free to experiment!您可以把许多命令到批处理文件如你所愿,您可以随意实验!

I’ve written an extensive post on我写了广泛的邮政对 how to use batch files in Windows 如何使用批处理文件在Windows , so read that if you are not familiar with batch files. ,因此,阅读,如果你不熟悉的批处理文件。 Enjoy!享受!

Technorati Tags: Technorati标记: , , , , ,

If you enjoyed this post, make sure you 如果您喜欢这个职位,请务必 subscribe to my RSS feed 订阅我的RSS馈送 !

» Filed Under »提交下 Computer Tips电脑提示

Related Posts相关文章

Please post your comments/suggestions!请张贴您的意见/建议!