win重啟遠端電腦

aishu521發表於2013-01-15

1,遠端開啟遠端telnet 服務

2 //指令碼

@echo off
echo set sh=WScript.CreateObject("WScript.Shell") >telnet_tmp.vbs
echo WScript.Sleep 300 >>telnet_tmp.vbs
echo sh.SendKeys "open 10.182.*.*{ENTER}" >>telnet_tmp.vbs //開啟遠端電腦IP
echo WScript.Sleep 300 >>telnet_tmp.vbs
echo sh.SendKeys "Y{ENTER}" >>telnet_tmp.vbs  
echo WScript.Sleep 300 >>telnet_tmp.vbs
echo sh.SendKeys "administrator{ENTER}" >>telnet_tmp.vbs //登入使用者名稱稱
echo WScript.Sleep 300 >>telnet_tmp.vbs
echo sh.SendKeys "****{ENTER}" >>telnet_tmp.vbs  //密碼
echo WScript.Sleep 3000 >>telnet_tmp.vbs
echo sh.SendKeys "shutdown -r -t 0{ENTER}" >>telnet_tmp.vbs //重新啟動電腦 等待0秒
echo sh.SendKeys "exit{ENTER}" >>telnet_tmp.vbs
start telnet
cscript. //nologo telnet_tmp.vbs
del telnet_tmp.vbs
ntsd -c q -pn telnet.exe  //關閉telnet

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15187685/viewspace-752669/,如需轉載,請註明出處,否則將追究法律責任。

相關文章