I have turned on EnableDelayedExpansion:
setlocal EnableDelayedExpansion How can I turn it off (using code)?
Use setlocal DisableDelayedExpansion. On the command prompt, type setlocal /? to see this indicated. This related question (not a dupe) suggests using setlocal /? to get help with setlocal and also provides more information about setlocal in general.
setlocal DisableDelayedExpansionorEndLocal. But If you use the latter, you'll lose all variables you've changed/created after thesetlocal EnableDelayedExpansion