Is there a way we can get Command prompt of windows 7 back? In linux we append "&" ? I actually run a java program which will listen on a port continously. It is working in lunux as it gives the terminal back but "&" is not working in the windows cmd. Thanks
Asked
Active
Viewed 675 times
2 Answers
3
I suggest you use the START
command but please be aware that it opens the process in a new window.
You can read about its syntax at http://www.computerhope.com/starthlp.htm .

Bruno Silva
- 3,077
- 18
- 20
2
start the java program with javaw instead of java. See this answer for some info on javaw. Difference between java.exe and javaw.exe
-
Thanks. I did use javaw in a bat file but the cmd still remains open in listening mode. My bat file is for example javaw listen.java It runs the program but does not quit the terminal. Any idea why – shujaat Feb 25 '12 at 05:48
-
Huh, in that case please 'un-accept' the answer. That could get you a better answer. For more clarify, you may tell more about listen.java. like if the program access stdin etc – Jayan Feb 25 '12 at 05:52
-
Thanks for the reply it actually opens a port on which different applications could listen. Its more like a server/ client. It works fine if I open the cmd and run it manually. But in a bat file javaw acts as a java. any idea – shujaat Feb 25 '12 at 05:56
-
In a batch file, use the START command if you don't want to wait for the process to exit. – Harry Johnston Feb 27 '12 at 04:03
-
@shujaat: I guess, your program depends on some kind of console access. javaw does not provide one. When the program is is hanging could you take a thread dump? See http://docs.oracle.com/javase/6/docs/technotes/guides/visualvm/threads.html for taking dump using visualvm. You may better of with a new question.. – Jayan Feb 27 '12 at 04:59