Board logo

标题: [文本处理] 批处理怎么一次打开25个网页然后,关掉浏览器,循环? [打印本页]

作者: xzy1006    时间: 2018-12-17 21:52     标题: 批处理怎么一次打开25个网页然后,关掉浏览器,循环?

  1. @echo off
  2. ::设置间隔时间
  3. set t=25
  4. for /f "tokens=*" %%i in (link1.txt) do (
  5. start "iexplore" "%%i"
  6. ping -n %t% 127.1>nul
  7. taskkill /f /im iexplore.exe
  8. ping -n 2 127.1>nul)
复制代码
目前这个批处理,只能一次打开一个网址,然后关掉浏览器,循环!
怎么改进成一次打开25个网页然后,关掉浏览器,再打开25个网址,关掉浏览器,循环!
非常感谢!
作者: heyoug    时间: 2018-12-18 14:30

传说中的恶作剧?
作者: xzy1006    时间: 2018-12-18 14:52

回复 2# heyoug


    不是啊,这是网站需要用到的!新人求助
作者: flashercs    时间: 2018-12-18 15:04

本帖最后由 flashercs 于 2018-12-18 15:59 编辑
  1. @echo off
  2. setlocal enabledelayedexpansion
  3. ::设置间隔时间
  4. set t=25
  5. set /a n=1
  6. :loop
  7. for /f "tokens=*" %%i in (link1.txt) do (
  8. start "iexplore" "%%i"
  9. ping -n %t% 127.1>nul
  10. if !n! geq 25 (
  11. REM 延迟60秒
  12.   timeout /t 60 /nobreak
  13.   taskkill /f /im iexplore.exe
  14.   ping -n 2 127.1>nul
  15.   set /a n=1
  16. ) else (
  17.   set /a n+=1
  18. )
  19. )
  20. goto loop
  21. endlocal
复制代码

作者: xzy1006    时间: 2018-12-18 15:22

本帖最后由 xzy1006 于 2018-12-18 15:51 编辑

回复 4# flashercs


    搞定啦,谢谢!
作者: xzy1006    时间: 2018-12-18 15:50

回复 5# xzy1006


    搞定啦,谢谢!




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2