Well, I know this might be a noob question, but I couldn't find the answer anywhere else. My Java class instructor didn't even know the answer. I'm trying to have the black command prompt window to close automatically when I hit exit in a basic java program instead of giving me "Press any key to continue...". Is there a code or a snippet that can help me do this?
Automatically Close Command Prompt Window
Page 1 of 19 Replies - 25081 Views - Last Post: 26 January 2009 - 06:45 PM
Replies To: Automatically Close Command Prompt Window
#2
Re: Automatically Close Command Prompt Window
Posted 25 January 2009 - 08:01 PM
Try closing the application using this code:
System.exit(0)
#3
Re: Automatically Close Command Prompt Window
Posted 25 January 2009 - 08:05 PM
#4
Re: Automatically Close Command Prompt Window
Posted 25 January 2009 - 08:08 PM
Ummm...I don't know of any way to do that while your application is not in a stand-alone executable form. As a matter of fact...I don't believe there is a way.
This post has been edited by Locke: 25 January 2009 - 08:09 PM
#5
Re: Automatically Close Command Prompt Window
Posted 26 January 2009 - 06:19 PM
What about:
getRuntime().exec("EXIT");
getRuntime().exec("EXIT");
#6
Re: Automatically Close Command Prompt Window
Posted 26 January 2009 - 06:21 PM
#7
Re: Automatically Close Command Prompt Window
Posted 26 January 2009 - 06:27 PM
#8
Re: Automatically Close Command Prompt Window
Posted 26 January 2009 - 06:33 PM
Thanks for your repliesand support guys... I believe there is no way to do it then... Thanks for all your help again.
#9
Re: Automatically Close Command Prompt Window
Posted 26 January 2009 - 06:34 PM
#10
Re: Automatically Close Command Prompt Window
Posted 26 January 2009 - 06:45 PM
Did you try pbl's suggestion?
It might work, it's at least worth a shot.
[/quote]
yeah, I tried tha, but it's giving me more problems. 100% of people I talked to said that it's impossible, so I'm going to stick with their answers.
Runtime.getRuntime().exec("EXIT");
It might work, it's at least worth a shot.
[/quote]
yeah, I tried tha, but it's giving me more problems. 100% of people I talked to said that it's impossible, so I'm going to stick with their answers.
Page 1 of 1

New Topic/Question
Reply



MultiQuote






|