Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 如何修剪文件扩展名并将其保存到bat中的另一个变量?_Windows_Batch File - Fatal编程技术网

Windows 如何修剪文件扩展名并将其保存到bat中的另一个变量?

Windows 如何修剪文件扩展名并将其保存到bat中的另一个变量?,windows,batch-file,Windows,Batch File,这是mlexe.bat: ML /Zi /c /Fl /coff %1.asm LINK /subsystem:console %1.obj 它可以这样使用: mlexe hello mlexe hello.asm 但我希望它是这样工作的: mlexe hello mlexe hello.asm 如何修改它?请参见,您需要%~n1

这是mlexe.bat:

ML /Zi /c /Fl /coff %1.asm
LINK /subsystem:console %1.obj
它可以这样使用:

mlexe hello
mlexe hello.asm
但我希望它是这样工作的:

mlexe hello
mlexe hello.asm
如何修改它?

请参见,您需要
%~n1