「bat」遅延変数にfor文のサンプル

書式
setlocal enabledelayedexpansion
使用例

@echo off
setlocal enabledelayedexpansion

set gg = 0

for /l %%i in (1,1,4) do (
      set /a gg+=%%i
      echo !gg!
)
pause

 

batch

Posted by arkgame