标题: [文本处理] BAT批处理怎样调用TXT里的数据? [打印本页]
作者: sa3246 时间: 2014-1-15 13:32 标题: BAT批处理怎样调用TXT里的数据?
这个批处理打开闪退。。。。。。。怎么破- @echo off
- setlocal EnableDelayedExpansion
- color 0a
- cls
- echo
- for /f "tokens=1,2,3,4,5 delims= " %%i in (ls.txt) do
- echo set sh=WScript.CreateObject("WScript.Shell") >telnet_tmp.vbs
- echo WScript.Sleep 300 >>telnet_tmp.vbs
- echo sh.SendKeys "open %%i" >>telnet_tmp.vbs
- echo WScript.Sleep 300 >>telnet_tmp.vbs
- echo sh.SendKeys "{ENTER}" >>telnet_tmp.vbs
- echo WScript.Sleep 300 >>telnet_tmp.vbs
- echo sh.SendKeys "admin{ENTER}">>telnet_tmp.vbs
- echo WScript.Sleep 300 >>telnet_tmp.vbs
- echo sh.SendKeys "admin{ENTER}">>telnet_tmp.vbs
- echo WScript.Sleep 300 >>telnet_tmp.vbs
- echo sh.SendKeys "save{ENTER}">>telnet_tmp.vbs
- echo WScript.Sleep 300 >>telnet_tmp.vbs
- echo sh.SendKeys "exit{ENTER}">>telnet_tmp.vbs
- echo WScript.Sleep 300 >>telnet_tmp.vbs
- start telnet
- cscript //nologo telnet_tmp.vbs
- ren telnet_tmp.vbs %%i.dat
- del telnet_tmp.vbs
复制代码
作者: DAIC 时间: 2014-1-15 13:45
for命令的do后面少了括号- for /f "tokens=1,2,3,4,5 delims= " %%i in (ls.txt) do (
- xxoo
- ooxx
- )
复制代码
作者: sa3246 时间: 2014-1-15 13:53
回复 2# DAIC
我加了以后,不闪退了,但是还是有问题
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |