dos特殊变量

1
2
3
4
5
6
7
8
9
#脚本路径
echo %~f0%
#脚本名
echo %~n0

#将脚本中空格替换为下划线
SET NAME=%~n0
SET NAME=%NAME: =_%
echo %NAME%