远程关闭Windows 2008服务器

来源:互联网 发布:乐视超级电视设置网络 编辑:程序博客网 时间:2024/05/16 09:18

编写一个bat脚本。

命令分两部分,
第一步是登录远程Windows 2008服务器(否则第二步会报错access denied),
第二步关机,注意shutdown命令在c:\windows\system32目录下面,需要在脚本里面写下exe文件所在路径c:\windows\system32

net use \\af007\IPC$ mypassword /USER:Administrator

c:\windows\system32\shutdown /s -m \\af007 -t 1


注意:脚本里面必须带上shutdown命令的PATH
注意:其中af007是我的Windows 2008服务器主机名


参考:
微软官方参考:http://technet.microsoft.com/en-us/library/cc770416.aspx

0 0