Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMD Script: How to close the CMD

I have created a small command that will let me launch Internet Explorer. However, I wish to close the small command prompt that shows up when I launch IE. How can I do this? This is my current code:

"%ProgramFiles%\Internet
Explorer\iexplore.exe"
http://localhost/test.html
PAUSE

I am guessing if I take out the Pause. It will close the CMD box upon closing IE??

Also is there another command that I can use to simply create a command that will let me add something to the Menu with a small icon, which in turn runs the above. Is this complicated? Any tutorials I can use?

Thanks all

like image 363
Abs Avatar asked Oct 05 '09 22:10

Abs


People also ask

How do I close a batch script?

EXIT /B at the end of the batch file will stop execution of a batch file. use EXIT /B < exitcodes > at the end of the batch file to return custom return codes.

How do you exit a loop in cmd?

In a looping statement, the break command ends the loop and moves control to the next command outside the loop.

How do you close a program with a script?

Type taskkill /IM your-program-name. your-program-extension /T /F and then hit ↵ Enter . Repeat this command for as many programs as you want! When finished, type exit on the last line and hit ↵ Enter .


1 Answers

Use the start command:

start "title" "%ProgramFiles%\Internet Explorer\iexplore.exe" http://www.example.com
like image 98
Dirk Vollmar Avatar answered Sep 29 '22 07:09

Dirk Vollmar