Results 1 to 5 of 5
Thread: CMD Issue
- 01-19-2012, 09:05 PM #1
CMD Issue
I want to create a batch file to:
Launch a Executable Jar file (the program is ran in CMD, so I want the CMD to be open and run it, all by clicking the batch file) or to launch a .java, but I can change that myself.
Then, I want the CMD to stay open, rather than closing.
Any idea how I can do this?
All the ways I've tried seem to just close as soon as they pop up, so when I launch it, the CMD just pops up & I see the program and it closes.
I want to be able to keep the CMD up until I want to close it, not using the CMD function 'pause', as when I use this, upon pressing a key it closes.
- 01-19-2012, 09:33 PM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,537
- Rep Power
- 11
Re: CMD Issue
cmd has a /K option that starts a new instance of the command interpreter, carries out a specified command and then remains rather than terminates. You can see all of the options by typing the following at the command prompt:
So you could try one or other of the following (note that it is a class that is launched not a .java file)Java Code:cmd /?
Java Code:cmd /K java -cp . MainClass args here cmd /K java -jar app.jar args here
- 01-19-2012, 10:43 PM #3
- 01-20-2012, 07:07 AM #4
Re: CMD Issue
What's your OS?
db
edit To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.Why do they call it rush hour when nothing moves? - Robin Williams
- 01-20-2012, 11:07 AM #5
Re: CMD Issue
Windows 7 Home Premium
http://www.mediafire.com/?29o6vx1rqklmdll
That's the .jar file if anyone wants to try :)Last edited by Gee; 01-20-2012 at 11:10 AM.
Similar Threads
-
How do I fix this issue?
By m4mm4l in forum New To JavaReplies: 8Last Post: 11-17-2011, 03:49 AM -
JSP issue
By RamaLakshmi in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 01-21-2011, 01:55 PM -
nio issue
By mawandiadeepak in forum NetworkingReplies: 2Last Post: 03-17-2010, 05:23 AM -
JSF issue
By premjo in forum New To JavaReplies: 0Last Post: 02-14-2010, 02:19 PM -
Issue
By FlashNinja in forum New To JavaReplies: 20Last Post: 11-28-2009, 09:44 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks