Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Execute java jar from vbscript

3,148 views
Skip to first unread message

pbe...@gmail.com

unread,
Nov 15, 2006, 4:32:18 PM11/15/06
to
How do I run a java jar file from within a vbscript?

I tried this

createobject("wscript.shell").exec "java -jar abc.jar"

but it opens a command window, runs java, then dies immediately before
it does anything. I know that "java -jar abc.jar" works properly when
called from the command line. Explicitly stating the paths to java and
abc.jar also fails.

Many thanks,

Phil

Tom Lavedas

unread,
Nov 15, 2006, 4:54:34 PM11/15/06
to
Try using the Run method instead ...

createobject("wscript.shell").RUN "java -jar abc.jar", 0, True ' if
to be synchronous

or

createobject("wscript.shell").RUN "java -jar abc.jar", 0, False ' if
to be asynchronous

Tom Lavedas
=============
http://members.cox.net/tglbatch/wsh

pbe...@gmail.com

unread,
Nov 15, 2006, 5:10:46 PM11/15/06
to
Thanks for the response.

I tried both methods, using run. In both cases, a wscript task
started, then finished immediately. However, java never started, and
the jar file did not execute.

Do you have any other suggestions?

Many thanks,

Phil

pbe...@gmail.com

unread,
Nov 15, 2006, 5:12:24 PM11/15/06
to
Thanks for the response.

I tried both methods, using run. In both cases, a wscript task
started, then finished immediately. However, java never started, and
the jar file did not execute.

Do you have any other suggestions?

Many thanks,

Phil

pbe...@gmail.com

unread,
Nov 15, 2006, 5:21:21 PM11/15/06
to
It's working now.

We had a problem in the jar script. Apparently the vbscript did start
java, but it exited so quickly we never saw it. Now the jar script is
correct and the vbscript is working properly.

Thanks again.

Phil

0 new messages