según @pk use pushd & popd, aquí hay un ejemplo.
use pushd para crear una unidad virtual temporal y, una vez hecho, haga un popd para eliminar la unidad virtual temporal
:selectFolder
REM Confirm which Folder structure
set /p location="Delete files for which QA environment: (P)retoria, (C)ape, (L)uanda or (Q)uit? (C/L/P/Q)"
REM I option allows for upper and lower case
if /I "%location%"=="C" set folder="\\Tfwcqa\tfwcqa\EORDERS"
if /I "%location%"=="L" set folder="\\Tfluaqa\tfluaqa\EORDERS"
if /I "%location%"=="P" set folder="\\Tfptaqa\tfptaqa\EORDERS"
if /I "%location%"=="Q" goto endBatch
REM you can not cd to a network drive so we use pushd to create a temporary virtual drive
REM cd /d %folder%
pushd %folder%
DIR /S
REM popd deletes the temporary virtual drive
popd