Windows Batch 用法

当前脚本目录

1
%~dp0

当前目录

1
for %%* in (.) do set CurrentDirName=%%~nx*

当前目录(不带斜线 )

1
2
SET mypath=%~dp0
echo %mypath:~0,-1%