for ... %%i variables can be used between call operators
#39
andry81
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Tested on:
Tests:
https://github.com/andry81/contools--debug/tree/HEAD/test_for_vars_between_calls.bat
Results:
Note
Additionally, the variables does survive the
setlocalcontext switch.Note
You have to use another
forstatement to use an externalforvariable.Note
for %%i instatement does use a file globbing feature, so you have to avoid a file globbing characters like?and*, otherwisecmd.exewill issueQueryDirectorycalls on a value and a value or theforrange can change.Note
The
for %%a in (:) do for %%i in (%%i) dostatement gains a valid result.Beta Was this translation helpful? Give feedback.
All reactions