变量延迟和命令行参数的问题- if "%1"=="" (
- cmd /s /k "%~s0 asdfg 1 5&exit"
- exit
- )
- @echo off & setlocal enableDelayedExpansion
- set key=%1
- set num=%2
- set len=%3
- set abb=0
- for /l %%i in (1,%num%,%len%) do (
- set /a abb+=1
- echo index=!abb!
- if !abb! LSS 10 (
- set /p=%key%%%i<nul>>1.txt
- )
- )
- pause
复制代码
[ 本帖最后由 neorobin 于 2010-6-30 16:27 编辑 ] |