‘建立Shell对象
set sh=WScript.CreateObject("WScript.Shell")
WScript.Sleep 1000
‘启动telnet,注意要保证telnet.exe程序所在的路径如c:\winnt\system32在path环境变量中
sh.Run "telnet.exe"
WScript.Sleep 1000
‘向telnet发送我们平时录入的命令
sh.SendKeys "open 192.168.10.120"
WScript.Sleep 1000
sh.SendKeys "{ENTER}"
WScript.Sleep 1000
sh.SendKeys "n{ENTER}"
sh.SendKeys "{ENTER}"
WScript.Sleep 1000
‘发送登陆用户User
sh.SendKeys "administrator{ENTER}"
WScript.Sleep 1000
‘发送登陆密码pass
sh.SendKeys "joyinter.com{ENTER}"
WScript.Sleep 1000
‘运行相关命令pwd
sh.SendKeys "cd liuxue{ENTER}"
‘运行退出TELNET登陆命令
sh.SendKeys "mkdir 123{ENTER}"
sh.SendKeys "echo quit>>12.txt{ENTER}"
sh.SendKeys "quit{ENTER}"
利用vbs脚本远程telnet执行远程主机程序
- THE END -
Category: Vbs
发表评论?
4 条评论。
发表评论
Trackbacks and Pingbacks:
- Shell脚本到telnet到远程Linux主机执行操作 | 忘川彼岸 - Pingback on 2011/03/29/ 13:35
- Shell脚本到telnet到远程Linux主机执行操作 - KingGoo - Pingback on 2011/03/16/ 18:46
密码早改过了~~~~~
Very true! Makes a chgane to see someone spell it out like that. 🙂