是某个工具,分两次执行,我嫌麻烦,准备一步到位,请教下:
echo sh.SendKeys "cat /var/tel_passwd | head -n 2 | tail -n 1 | cut -d : -f 2{ENTER}" >>telnet_tmp.vbs
这时得到"XXXXXXXX"字符串,怎样把这字符串直接填到下个语句的需要的地方?- arp -d
- echo set sh=WScript.CreateObject("WScript.Shell") >telnet_tmp.vbs
- echo WScript.Sleep 300 >>telnet_tmp.vbs
- echo sh.SendKeys "open 192.168.1.1{ENTER}" >>telnet_tmp.vbs
- echo WScript.Sleep 300 >>telnet_tmp.vbs
- echo sh.SendKeys "useradmin{ENTER}" >>telnet_tmp.vbs
- echo WScript.Sleep 1000 >>telnet_tmp.vbs
- echo sh.SendKeys "useradmin{ENTER}" >>telnet_tmp.vbs
- echo WScript.Sleep 300 >>telnet_tmp.vbs
- echo sh.SendKeys "cat /var/tel_passwd | head -n 2 | tail -n 1 | cut -d : -f 2{ENTER}" >>telnet_tmp.vbs
- echo WScript.Sleep 300 >>telnet_tmp.vbs
- echo sh.SendKeys "root{ENTER}" >>telnet_tmp.vbs
- echo WScript.Sleep 1000 >>telnet_tmp.vbs
- echo sh.SendKeys "XXXXXXXX{ENTER}" >>telnet_tmp.vbs
- echo WScript.Sleep 300 >>telnet_tmp.vbs
复制代码
|