Windows环境下telnet自动登录和运行脚本
今天,花费1个小时,研究了一下在Windows下,使用Telent登录至UNIX的脚本,现将其贴下,以供下次使用(tt.bat)
@echo off
echo set sh=WScript.CreateObject(“WScript.Shell”) >telnet_tmp.vbs
echo WScript.Sleep 3000 >>telnet_tmp.vbs
rem —————-UNIX IPAddress
echo sh.SendKeys “open 10.0.18.100{ENTER}” >>telnet_tmp.vbs
echo WScript.Sleep 3000 >>telnet_tmp.vbs
rem —————-userID
echo sh.SendKeys “root{ENTER}” >>telnet_tmp.vbs
echo WScript.Sleep 3000 >>telnet_tmp.vbs
rem —————-password
echo sh.SendKeys “root{ENTER}” >>telnet_tmp.vbs
echo WScript.Sleep 3000 >>telnet_tmp.vbs
echo sh.SendKeys “ls {ENTER}”>>telnet_tmp.vbs
start telnet
cscript //nologo telnet_tmp.vbs
rem del telnet_tmp.vbs
原文:http://www.blogjava.net/raozhh/archive/2011/10/10/360396.html
本文出自 传播、沟通、分享,转载时请注明出处及相应链接。
本文永久链接: https://www.nickdd.cn/?p=1778