Search found 3 matches

by gdiddy
29 Jan 2009 13:13
Forum: DOS Batch Forum
Topic: Using "set" within a for loop?
Replies: 3
Views: 6722

In case anyone cares, the answer is delayed expansion. Corrected code setlocal ENABLEDELAYEDEXPANSION set count=1 for /f "tokens=1" %%i in (PortList) do ( echo !count!^) %%i set /A count=!count!+1 ) set /A count=%count%-1 echo. set /P input=Please select [1-%count%]:
by gdiddy
29 Jan 2009 11:12
Forum: DOS Batch Forum
Topic: Using "set" within a for loop?
Replies: 3
Views: 6722

Nobody?
by gdiddy
28 Jan 2009 16:40
Forum: DOS Batch Forum
Topic: Using "set" within a for loop?
Replies: 3
Views: 6722

Using "set" within a for loop?

I'm utterly confused. "set" is acting very strangely within a for loop. Here's my code. PortList is a file with 4 lines of text. set count=1 for /f "tokens=1" %%i in (PortList) do ( echo %count%^) %%i set /A count=%count%+1 ) echo. set /P input=Please select [...