vendredi 21 septembre 2018

If this title isn't the title of this program, then do this. How do I do that with a if or for in a Batch file?

I am trying to code a program called "FIGHT!.bat", and I want to make it so that you need to keep the title the same as you downloaded it, otherwise an error message would pop up. But I can't do what I want to do. Here is the code so far:

@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
...

This is alright, but if another Batch file is called that, then the game itself can be run with a different title, and I don't want that. Is there any way to check the name of the program so that if the name isn't "FIGHT!.bat", do this?

Thanks.

Aucun commentaire:

Enregistrer un commentaire