Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7190

I can't find the cause of the crash in my .bat file

$
0
0

So I got bored and started messing around with .bat scripts. Its important to note that today is really my first time trying it.

Anyway I started toying around with a script I found online that emulates the WOPR computer from Wargames. Now everything was running fine until I try to execute options 4 and 5. This will cause a ctd immediately after performing the 5 second timeout. I can't for the life of me figure out why. Any help would be much appreciated.

Please be gentle this is my first post here and I'm not used to posting in forums.

@echo offtitle Shall We Play a Game?set /a "tries=3"set "password=JOSHUA":topecho  %tries% Tries Remainingset /p "pass=Password: "if "%pass%"=="%password%" (goto correct)set /a "tries=%tries% -1"if %tries%==0 (goto penalty)clsgoto top:penaltyecho CONNECTION TERMINATEDpauseexit:correctgoto greeting:greetingecho GOOD DAY PROFESSOR FALKENecho.echo SHALL WE PLAY A GAME?echo [Y/N]set /p "input="if "%input%"=="y" goto yif "%input%"=="n" goto n:yclsecho 1. FALKENS MAZETimeout /t 1 /nobreak > nulecho.echo 2. CHESSTimeout /t 1 /nobreak > nulecho.echo 3. POKERTimeout /t 1 /nobreak > nulecho.  echo 4. FIGHTER COMBATTimeout /t 1 /nobreak > nulecho.echo 5. GUERILLA ENGAGEMENTTimeout /t 1 /nobreak > nulecho.echo 6. DESERT WARFARETimeout /t 1 /nobreak > nulecho.echo 7. AIR-TO-GROUND ACTIONSTimeout /t 1 /nobreak > nulecho.echo 8. THEATERWIDE TACTICAL WARFARETimeout /t 1 /nobreak > nulecho.echo 9. THEATERWIDE BIOLOGICAL AND CHEMICAL WARFARETimeout /t 1 /nobreak > nulecho. echo 0. GLOBAL THERMONUCLEAR WARTimeout /t 1 /nobreak > nulecho PLEASE MAKE A SELECTION PROFESSORecho [0-9]set /P "opt="if "%opt%"=="1" goto mazeif "%opt%"=="2" goto chessif "%opt%"=="3" goto pokerif "%opt%"=="4" goto fighterif "%opt%"=="5" goto guerilla:n echo THATS TOO BAD MAYBE WE SHOULD PLAY SOME OTHER DAY!pauseexit:mazeclsecho YOU HAVE ENTERED THE FALKENS MAZETimeout /t 1 /nobreak > nulclsecho ERROR: UNKNOWN ERROR OCCURREDTimeout /t 1 /nobreak > nulecho.echo EXITING PROGRAM . . .Timeout /t 1 /nobreak > nulexit:chessclsecho YOU HAVE ENTERED CHESSTimeout /t 1 /nobreak > nulclsecho ERROR: UNKNOWN ERROR OCCURREDTimeout /t 1 /nobreak > nulecho.echo EXITING PROGRAM . . .Timeout /t 1 /nobreak > nulexit:pokerclsecho YOU HAVE ENTERED POKERTimeout /t 1 /nobreak > nulclsecho ERROR: UNKNOWN ERROR OCCURREDTimeout /t 1 /nobreak > nulecho.echo EXITING PROGRAM . . .Timeout /t 1 /nobreak > nulexit:fighterclsecho YOU HAVE ENTERED FIGHTER COMBATTimeout /t 1 /nobreak > nulclsecho ATTEMPTING TO CONNECT TO AIR COMBAT COMMAND. . .Timeout /t 5 /nobreak > nulecho.echo UNABLE TO CONNECT TO AIR COMBAT COMMAND echo.echo SHUTTING DOWNexit:guerillaclsecho YOU HAVE ENTERED GUERILLA ENGAGEMENTTimeout /t 1 /nobreak > nulclsecho ATTEMPTING TO CONNECT TO UNITED STATES SPECIAL OPERATIONS COMMAND. . .Timeout /t 5 /nobreak > nulecho.echo UNABLE TO CONNECT TO UNITED STATES SPECIAL OPERATIONS COMMANDecho.echo SHUTTING DOWNexit

Also this was written in VSCode and is being run in cmd. If there's a way to debug it before hand I don't know it


Viewing all articles
Browse latest Browse all 7190

Trending Articles