如何从脚本本身获取Windows .bat脚本的名称?

我有一个.bat文件.我想以编程方式获取.bat文件名称.我怎样才能做到这一点?

这是我的最终目标

"..\lib\nant\nant.exe" -buildfile:nant.build {{pass in name of this file here}}
pause
试试/?在命令行上.帮助显示各种有用的文件名替换,例如:
%~I         - expands %I removing any surrounding quotes (")
%~fI        - expands %I to a fully qualified path name
%~dI        - expands %I to a drive letter only
%~pI        - expands %I to a path only
%~nI        - expands %I to a file name only
%~xI        - expands %I to a file extension only

将I替换为0以获取批处理文件名,并将I替换为1,2,3等以获取参数名称.

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...