bat 批处理中的各种环境路径

136 阅读1分钟

当前盘符

echo current disk: %~d0

当前盘符和路径

echo current disk and path: %~dp0

当前 bat 文件 路径

echo current absolute path: %~f0

当前盘符和短文件名

echo current disk and short path: %~sdp0

当前 CMD 默认目录

echo current cmd directory: %cd%

参考

bbs.csdn.net/topics/3102…