Is there a way to enable the execution variable extension for cmd.exe (usually done by typing cmd /V:ON) without starting a new instance of cmd.exe?
cmd /V:ON
Similarly, can other parameters / flags be changed on the fly?
Try the following:
setlocal enabledelayedexpansion
There also
setlocal enableextensions
which is equivalent cmd /E:ON.
cmd /E:ON
Link: setlocal /?.
setlocal /?
Try
setlocal ENABLEDELAYEDEXPANSION