tags:

views:

771

answers:

2

Is there any way to enable execution-time variable expansion for cmd.exe (normally done by typing cmd /V:ON) without starting a new instance of cmd.exe?

Similarly, can other settings/flags be changed on the fly?

+4  A: 

Try this:

setlocal enabledelayedexpansion

There's also

setlocal enableextensions

which is the equivalent of cmd /E:ON.

Reference: setlocal /?.

Blorgbeard
A: 

Try

setlocal ENABLEDELAYEDEXPANSION
Jason Punyon