setlocalã³ãã³ã
setlocalã¯endlocalã¾ãã¯exitãå¼ã°ããã¾ã§æå¹ã§ãã
@echo off set /a n = 1 setlocal set /a n = 2 setlocal set /a n = 3 echo %n% endlocal echo %n% endlocal echo %n%
3 2 1
æ°ãã¤ããªããã°ãããªãã®ã¯ãsetlocalã¯é¢æ°ãå¼ãã å ã§ãæå¹ã¨ãããã¨ã§ãã
@echo off set /a n = 2 setlocal call :f echo %n% endlocal echo %n% exit /b 0 :f rem // ããã§ã»ãããã¦ãsetlocalãæå¹ set /a n = 1 exit /b 0
1 2