我发了一种笨方法,因为for里面的skip不支持变量书写(skip=!str!)
好像不加这个(C:\Program Files\Internet Explorer\IEXPLORE.EXE)的话会一闪而过
还有不明白IF和START那句为什么这样写不行- if "!num!" leq "10" (start "" %a% "%%i")
复制代码
- @echo off
- setlocal enabledelayedexpansion
- set a="C:\Program Files\Internet Explorer\IEXPLORE.EXE"
- set num=0
- for /f "delims=" %%i in (3.txt) do (
- echo %%i
- set /a num+=1
- set str+=1
- echo !num!
- start "" %a% "%%i"
- if "!num!" equ "10" goto a
- )
- :a
- pause
- set num=0
- for /f "skip=10 delims=" %%i in (3.txt) do (
- echo %%i
- set /a num+=1
- set str+=1
- echo !num!
- start "" %a% "%%i"
- if "!num!" equ "10" goto b
- )
- :b
- pause
- set num=0
- for /f "skip=20 delims=" %%i in (3.txt) do (
- echo %%i
- set /a num+=1
- set str+=1
- echo !num!
- start "" %a% "%%i"
- if "!num!" equ "10" goto c
- )
- :c
- pause
- set num=0
- for /f "skip=30 delims=" %%i in (3.txt) do (
- echo %%i
- set /a num+=1
- set str+=1
- echo !num!
- start "" %a% "%%i"
- if "!num!" equ "10" goto d
- )
- :d
- pause
- set num=0
- for /f "skip=40 delims=" %%i in (3.txt) do (
- echo %%i
- set /a num+=1
- set str+=1
- echo !num!
- start "" %a% "%%i"
- if "!num!" equ "10" goto e
- )
- :e
- set num=0
- for /f "skip=50 delims=" %%i in (3.txt) do (
- echo %%i
- set /a num+=1
- set str+=1
- echo !num!
- start "" %a% "%%i"
- if "!num!" equ "10" goto f
- )
- :f
- pause
复制代码
|