23
I've been programming in dozens of languages for 20 years but I could never understand how "FOR" work in windows cmd shell batch file, no matter how hard I tried. I read
http://www.ss64.com/nt/for.html
and several other articles on the internet but still confuse and cannot accomplish anything.
Can anybody give me a concise explaination on how "FOR" works in general ?
For a little more specific question, how can I iterate through each path in %PATH% variable ? I've tried with
rem showpathenv.bat
for /f "delims=;" %%g in ("%PATH%") do echo %%g
That'd show only the first path, not all of them. Why ? What I do wrong ?