batch loop set variable

December 9, 2010 at 09:48:54
Specs: MSDOS
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


See More: batch loop set variable

Report •

#1
December 9, 2010 at 23:45:38
@echo off
setlocal enabledelayedexpansion
for %%c in (1,2,3,4) do (
set input=
set /p input=Type input:%=%
echo Your input was: !input!
)

Did you Google for an answer before asking the question?


Report •
Related Solutions


Ask Question