.bat 文件实现for循环多次重复执行一个命令

@echo off & setlocal EnableDelayedExpansion

set objLength=6
set obj[0]=test1
set obj[1]=test2
set obj[2]=test3
set obj[3]=test4
set obj[4]=test5
set obj[5]=test6

set objIndex=0
:loopStart


if %objIndex% equ %objLength% goto end


for /f "usebackq delims== tokens=1-2" %%i in (`set obj[%objIndex%]`) do (
        echo %%j
   
 )
set /a objIndex=%objIndex% + 1
goto loopStart

:end
    



pause

你可能感兴趣的:(windows)