jeb wrote:dbenham wrote:The delayed expansion is somehow disabled when the command is aborted with Ctrl-C.
It has nothing to do with the Ctrl-C, but you could read this article Why does delayed expansion fail when inside a piped block of code?
jeb
Actually it does have something to do with Ctrl-C, since the value is expanded properly when I don't press Ctrl-C (I temporarily disabled the END condition test so that I could see the value). It fails to expand properly after I press Ctrl-C. My guess is the Ctrl-C kills the batch context, reverting to delayed expansion off. The loop continues to execute in command prompt mode since it is already fully parsed and is executing from memory.
Dave Benham