file_exist.bat文件内容如下:
注:pushd与popd可以切换到指定目录后再切回来,但是%~dp0依旧显示当前批处理文件所在目录。

@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

批处理基础(十二)切换盘符路径

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-04-03
  • 2021-08-25
  • 2022-12-23
  • 2021-05-21
  • 2021-06-21
  • 2022-12-23
相关资源
相似解决方案