I'v gotta change the variable via input for x amount of times.
@echo off
for %%counter in (1,2,3,4) do (
set input =
set /p input=Type input:%=%
echo Your input was: %input%
)
For some reason the variable doesn't change.
How can I change the variable contents
batch loop variable
Moderator: DosItHelp
Re: batch loop variable
Code: Select all
@echo off
setlocal enabledelayedexpansion
title delayedexpansion on
for %%c in (1,2,3,4) do (
set input=
set /p input=Type input:%=%
echo Your input was: !input!
)
endlocal
pause
setlocal disabledelayedexpansion
title delayedexpansion off
for %%c in (1,2,3,4) do (
set input=
set /p input=Type input:%=%
call echo Your input was: %%input%%
)
endlocal
pause