如何在批处理脚本中获取文件名?

时间:2018-09-21 21:42:52

标签: batch-file for-loop if-statement title

我正在尝试编写一个名为“ FIGHT!.bat”的程序,因此我想使它保持标题与下载的名称相同,否则会弹出错误消息。但是我做不到我想做的事。这是到目前为止的代码:

@echo off
if not exist FIGHT!.bat (
cls
echo Sorry, but an error has occured.
echo Redownloading the program or renaming the program can help.
pause
exit
) else (
goto logo
)
:logo
...

没关系,但是如果调用另一个批处理文件,那么游戏本身可以使用其他标题运行,我不希望这样。有什么方法可以检查程序的名称,如果名称不是“ FIGHT!.bat”,可以这样做吗?

谢谢。

0 个答案:

没有答案