file_exist.bat document reads as follows:
Note: pushd and popd can switch to the specified directory and then cut back, but% ~ dp0 still displays the current batch file directory.
@echo off
echo.
echo 当前盘符和路径:%~dp0
echo.
echo 当前路径下文件:
dir /b
echo.
echo 从当前盘符切换到G:\share目录下......
echo.
pushd G:\share
echo 当前路径下文件:
dir /b
echo 当前盘符路径:%~dp0
echo.
echo 切换回原盘符和路径......
popd
echo.
echo 当前路径下文件:
dir /b
echo 当前盘符路径:%~dp0