Just add an exit after the :end label and the script will close the command prompt when it ends.
Edit: I changed the topic subject since we got split off the original thread.
close command prompt
Moderators: fgagnon, nikos, Site Mods
- FrizzleFry
- Platinum Member
- Posts: 1241
- Joined: 2005 Oct 16, 19:09
close command prompt
Last edited by FrizzleFry on 2007 Jun 15, 23:50, edited 2 times in total.
- FrizzleFry
- Platinum Member
- Posts: 1241
- Joined: 2005 Oct 16, 19:09
Hmm, normally it would, but on my system it won't. Even without the Exit it would have to close the command prompt when the script ends. Only if you have specified a custom preamble (szDosCmdPreamble in registry) it could behave differently.
I'll investigate at home (where I ran the script, currently at work) and let you know.
I'll investigate at home (where I ran the script, currently at work) and let you know.
Dumb questions are the ones that are never asked
- FrizzleFry
- Platinum Member
- Posts: 1241
- Joined: 2005 Oct 16, 19:09
Hmm... my point is that if you end the batch/script file with an exit the command prompt will close when you run the script from x2's address/command bar. If you do not have an exit command the script will complete but the command prompt window will remain open.
This does not apply if you are redirecting DOS commands to x2's console.
This is my current preamble:
"szDosCmdPreamble"="cmd.exe /K "
I have adjusted this before to run 4nt instead of cmd but I think this is the standard x2 setting.
This does not apply if you are redirecting DOS commands to x2's console.
This is my current preamble:
"szDosCmdPreamble"="cmd.exe /K "
I have adjusted this before to run 4nt instead of cmd but I think this is the standard x2 setting.
My bad. I had a command in the "szDosCmdPreamble" which was no longer on my system. So when a 'normal' command prompt was started by X², it generated an error.
Strangely enough it did create the folders, but didn't execute the exit at the end of the script.
Normally I do have the X² DOS window enabled, so I didn't notice this quirk on my system until now.
Case closed AFAIC
Strangely enough it did create the folders, but didn't execute the exit at the end of the script.
Normally I do have the X² DOS window enabled, so I didn't notice this quirk on my system until now.
Case closed AFAIC
Dumb questions are the ones that are never asked
- FrizzleFry
- Platinum Member
- Posts: 1241
- Joined: 2005 Oct 16, 19:09