Closing a batch after starting an .exe file
<p>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.</p>

<p>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 )</p>

<p>I have looked at these questions :</p>

<p><a href="https://stackoverflow.com/questions/12314638/close-a-batch-file-after-running-the-jar-file">Close a batch file after running the jar file</a></p>

<p><a href="https://stackoverflow.com/questions/26106807/close-windows-command-prompt-after-all-process-completed-in-the-batch-file?rq=1">close windows command prompt after all process completed in the batch file</a></p>

<p><a href="https://stackoverflow.com/questions/26734286/cmd-exe-doesnt-close-after-starting-exe">cmd.exe doesn&#39;t close after starting exe</a></p>

<p>this is the problem Im having : Took a picture of the batch file when it runs which you can see on link below !</p>

<p><a href="https://i.stack.imgur.com/IV2Xs.png" rel="nofollow noreferrer">How the CMD looks when I run the batch file</a></p>

<p>Thanks in advance !</p>

<pre><code>@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&gt;nul
echo "   3   "
ping -n 2 127.0.0.1&gt;nul
echo "   2   "
ping -n 2 127.0.0.1&gt;nul
echo "   1   "
ping -n 2 127.0.0.1&gt;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 "|__________________&gt; 3.5 client profile &lt;__________________|"

cmd /K "%~dp0dotnetfx35.exe"
pause
EXIT


:end

exit
</code></pre>