cd %~dp0 就是进入批处理文件所在目录了

 

获取bat或cmd脚本文件自身所在目录_Ongoing的博客-CSDN博客 https://blog.csdn.net/zj1060911962/article/details/107624569

2.不同分区的切换

set str=%~dp0
for /f "delims=:" %%a in ("%str%") do (
set c1=%%a
)

%c1%:

cd %~dp0

 

 

BAT批处理文件 cd,dir命令详解_望语挽枫的博客-CSDN博客 https://blog.csdn.net/csqxy547/article/details/90758364

切换到x盘

x:

 

相关文章:

  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-04
  • 2021-05-19
猜你喜欢
  • 2021-08-20
  • 2021-10-15
  • 2021-09-10
  • 2022-12-23
相关资源
相似解决方案