[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] BAT批处理怎样调用TXT里的数据?

这个批处理打开闪退。。。。。。。怎么破
  1. @echo off
  2. setlocal EnableDelayedExpansion
  3. color 0a
  4. cls
  5. echo   
  6. for /f "tokens=1,2,3,4,5 delims= " %%i in (ls.txt) do
  7. echo set sh=WScript.CreateObject("WScript.Shell") >telnet_tmp.vbs
  8. echo WScript.Sleep 300 >>telnet_tmp.vbs
  9. echo sh.SendKeys "open %%i" >>telnet_tmp.vbs
  10. echo WScript.Sleep 300 >>telnet_tmp.vbs
  11. echo sh.SendKeys "{ENTER}" >>telnet_tmp.vbs
  12. echo WScript.Sleep 300 >>telnet_tmp.vbs
  13. echo sh.SendKeys "admin{ENTER}">>telnet_tmp.vbs
  14. echo WScript.Sleep 300 >>telnet_tmp.vbs
  15. echo sh.SendKeys "admin{ENTER}">>telnet_tmp.vbs
  16. echo WScript.Sleep 300 >>telnet_tmp.vbs
  17. echo sh.SendKeys "save{ENTER}">>telnet_tmp.vbs
  18. echo WScript.Sleep 300 >>telnet_tmp.vbs
  19. echo sh.SendKeys "exit{ENTER}">>telnet_tmp.vbs
  20. echo WScript.Sleep 300 >>telnet_tmp.vbs
  21. start telnet
  22. cscript //nologo telnet_tmp.vbs
  23. ren telnet_tmp.vbs %%i.dat
  24. del telnet_tmp.vbs
复制代码

for命令的do后面少了括号
  1. for /f "tokens=1,2,3,4,5 delims= " %%i in (ls.txt) do (
  2.     xxoo
  3.     ooxx
  4. )
复制代码

TOP

回复 2# DAIC


    我加了以后,不闪退了,但是还是有问题

TOP

返回列表