how do u make a .bat file close itself when its done?

SonicIce

Diamond Member
Apr 12, 2004
4,771
0
76
like if i told it to run "c:\asdf.exe" then is there a command to make the window close itself after the program launches like -close or -exit or something?
 

SonicIce

Diamond Member
Apr 12, 2004
4,771
0
76
thanks for quick reply (you are the greatest, man. i love your guide for pc build) anyways what im trying to do here is create a shortcut to a web page that you can open just by doubleclicking a shortcut. i use opera so i put in:

"C:\Program Files\Opera\opera.exe" -open "http://www.omnicast.net/~tmcfadden/guides/build/index.html" exit

but the window stays there after opera opens with the page. am i doing something wrong?
 

mundane

Diamond Member
Jun 7, 2002
5,603
8
81
try using the Start command. It should spawn off a new thread/process

i.e. start opera.exe -open webpage
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
A normal batch file runs the commands in sequence.
When a command completes, the next line is processed.

To start a command and then continue, you can use the method that diegoalcatraz posted.

The batch file will terminate after the last command in the sequence.
The exit command allows you to termiante early.