$ cd /d ...different real directory .. $ FOR /F "usebackq delims=" %I IN (`chdir`) DO title %~dnI && ECHO %cd%