Calling external file - cmd shuts
Posted: 23 Aug 2012 00:12
Hello everyone!
This is game.bat
and this is use.bat
But during the :CMD section of the program, if I type use sword (sword is an example) the cmd shuts...
Any suggestions as to why this is happening and how to fix it?
reaper17
This is game.bat
Code: Select all
echo off
title Game
color 0a
:BEGINNING
cls
if not exist %cd%\Data\ (
echo ERROR! FILES MISSING
pause
exit
) else (
goto GETVAR
pause
exit
)
if not exist %cd%\Story\ (
echo ERROR! FILES MISSING
) else (
goto GETVAR
pause
exit
)
:GETVAR
echo Initialising...
call Run-time\initialise.bat
cls
type %cd%\Story\story1.fldr
pause
:CMD
set cmd=null
cls
set /p cmd=Command:
if %cmd% == use (
%cmd%
goto CMD
)
if %cmd% == equip (
%cmd%
goto CMD
)
goto ERROR
:ERROR
cls
echo Invalid command (%cmd%)
pause
goto CMD
and this is use.bat
Code: Select all
echo %1
pause
But during the :CMD section of the program, if I type use sword (sword is an example) the cmd shuts...
Any suggestions as to why this is happening and how to fix it?
reaper17