I am trying to use setlocal enabledelayedexpansion and cd together in a batch script, which seems to not persist changes back to shell.
setlocal enabledelayedexpansion
cd
The
Here is proof that it works - start the batch file in any folder above the root.
@echo off setlocal enabledelayedexpansion echo "%cd%" cd .. echo "%cd%" pause