我有一个.bat文件.我想以编程方式获取.bat文件的名称.我怎样才能做到这一点?
@H_301_1@这是我的最终目标
"..\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@H_301_1@将I替换为0以获取批处理文件名,并将I替换为1,2,3等以获取参数名称.