This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes contents in the .bat file is not getting executed. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "contents in the .bat file is not getting executed. " Watch "contents in the .bat file is not getting executed. " New topic
Author

contents in the .bat file is not getting executed.

V Patil
Ranch Hand

Joined: Oct 04, 2008
Posts: 36
I am trying to run a java pgm using bat file.
This .bat file is executed running a java pgm.
.bat file is called but the content in .bat file is not getting executed.
.bat file is located in C:\Program Files\apache-tomcat-6.0.16\bin

.bat is called using following code


Please help.
Thanks in advance.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Are you sure the command is not executed? exitValue() does not block; it returns immediately. waitFor() is the blocking method that returns the return code.

Before you change any code you should search for and read the Javaworld article "When Runtime.exec() won't". It's a must-read when dealing with Process(Builder).


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
wood burning stoves
 
subject: contents in the .bat file is not getting executed.
 
Similar Threads
How to create a bat file to run a executable jar
Tomcat
compiling ActionForm,ActionClass from command prompt,
Classpath error
Tomcat is *almost* running