So I'm having Problem with closing the CMD after it runs a file ! in the code below as you can see I'm using an EXIT command but after pressing Enter the Drive name shows up and this happens again and again I have tried it without the pause to , it wont work ( I want it to pause there tho ) So i want it to exit the CMD after the user presses the Enter.
I gave a wrong .net framework number to it to test if it will run the exe file or not , it runs it but it wont close afterwards ( the cmd wont close i mean )
I have looked at these questions :
Close a batch file after running the jar file
close windows command prompt after all process completed in the batch file
cmd.exe doesn't close after starting exe
this is the problem Im having : Took a picture of the batch file when it runs which you can see on link below !
How the CMD looks when I run the batch file
Thanks in advance !
@echo off
echo " _____________________________ "
echo "| |"
echo "| softRAD Loader |"
echo "|_____________________________|"
echo " _________________________________________________________________________ "
echo "| |"
echo "| Checking the .Net Framework Installed on Your System |"
echo "|_________________________________________________________________________|"
REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v5.5" /v Version
IF %errorlevel%==0 GOTO INSTALL
IF %errorlevel%==1 GOTO UNINSTALL
:INSTALL
echo " __________________________________________________________ "
echo "| |"
echo "| .Net Framework v3.5 found , Starting the softRAD.exe |"
echo "|----------------------------------------------------------|"
echo "| This window closes in 3 seconds |"
echo "|__________________________________________________________|"
echo.
ping -n 2 127.0.0.1>nul
echo " 3 "
ping -n 2 127.0.0.1>nul
echo " 2 "
ping -n 2 127.0.0.1>nul
echo " 1 "
ping -n 2 127.0.0.1>nul
GOTO end
:UNINSTALL
echo " __________________________________________________________ "
echo "| |"
echo "| .Net Framework Not found , Attempting to Install it. |"
echo "|----------------------------------------------------------|"
echo "| If this Doesnt Work , Please Install the |"
echo "| .net Framework Included on the DVD manually. |"
echo "|__________________> 3.5 client profile <__________________|"
cmd /K "%~dp0dotnetfx35.exe"
pause
EXIT
:end
exit
"%~dp0dotnetfx35.exe"
– Squashman