windows自動登入linux 並執行指令碼

aishu521發表於2012-12-02
1,檔名:auto -linux_kill.bat
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.*.*" >>telnet_tmp.vbs  //連線伺服器
echo WScript.Sleep 300 >>telnet_tmp.vbs  //等待300
echo sh.SendKeys "{ENTER}" >>telnet_tmp.vbs
echo WScript.Sleep 300 >>telnet_tmp.vbs
echo sh.SendKeys "userid{ENTER}" >>telnet_tmp.vbs//登入帳戶
echo WScript.Sleep 300 >>telnet_tmp.vbs
echo sh.SendKeys "passwdENTER}" >>telnet_tmp.vbs //登入密碼
echo sh.SendKeys "sh k{ENTER}" >>telnet_tmp.vbs  //執行指令碼
echo WScript.Sleep 300 >>telnet_tmp.vbs
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
3,~]$ cat k
ps -ef|grep LOCAL|awk '{print $2}'|xargs kill -9;

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

相關文章