I am trying to do a very simple thing, I want to set a variable in Windows CMD and use it in a for loop, but for some reason my var is not loading inside the loop. Here's a simple example:
set myVar=someVal&&for /l %a in (0) do (echo %myVar%)
Let's say I want someVal to be echoed forever. One might assume this will print the val forever but when the loop starts it's like the variable was never set. Can someone point out what I'm missing?
I tried with single & and double &&. I also tried setlocal enabledelayedexpansion
etc.