KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Can anyone explain this? I am able to count in a loop using the Windows command prompt, using this method: SET /A XCOUNT=0 :loop SET /A XCOUNT+=1 echo %XCOUNT% IF "%XCOUNT%" == "4" ( GOTO end ) ELSE ( GOTO loop ) :end But this method does not work (it prints out "1" for each line in the file). It acts like the variable is out of scope: SET /A COUNT=1 FOR /F "tokens=*" %%A IN (config.properties) DO ( SET /A COUNT+=1 ECHO %COUNT% )
Tags (comma-separated)
Save Edits
Cancel