iteration - How does "FOR" work in cmd batch file? -
I'm programming in dozens of languages for 20 years but I can never understand how to "work" in windows Cmd shell batch file, no matter how hard I tried. I read
And many other articles on the internet are still confused and can not complete anything.
Can someone give me a brief explanation on how "FOR" works in general?
For a slightly more specific question, how can I be repeated through each path in the% PATH% variable? I have tried
for RIM showpathenv.bat / f "delims =;" In the %% G ("% PATH%") the resonance %% it shows only the first path, not all of them Why ? What should I do?
No one really works in the answer Bit hackes, but it resolves the problem for me:
Settlelock enabled setconction enabled enabled set expansion MAX_TRIES = 100 sets P =% PATH% for / L %% a in (1, 1,% MAX_TRIES%) (for "/ p" in delimits =; "%% g ("! P! ") (Resonance %% g set p =! P: %% g! =! If" ! P! "==" %% "goto: eof)) Oh! I hate batch file programming!
Updated
The solution to the mark is simple, but it will not work with the path along the path. -Content version is
Settlock enabled enabling expansion Unbankpath =% Pat: = #% Set TabbedPath =% NonBankPath:; =% %% g (% TabbedPath)%) Setting (Set GG = %% G Echo! GG: # =!)
Comments
Post a Comment