SETLOCAL ENABLEDELAYEDEXPANSION causes CD and PUSHD to not persist
问题 I am trying to use setlocal enabledelayedexpansion and cd together in a batch script, which seems to not persist changes back to shell. The reason I need setlocal enabledelayedexpansion is that I need the variables in the script to be expanded dynamically upon runtime of the script. Consider the below sample batch file : a.bat ================================ setlocal enabledelayedexpansion cd .. The above batch file does not migrate to previous directory as expected ! Check this. 回答1: The