I think Winston is assuming, as I am, that the JAR file will contain the Java program that is executed via the shell in VBScript, in which case: no you can't
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Joined: Feb 28, 2008
Thank you for quick response, however it will be really great if any of you can give me the way to write a java program, which returns a String value when jar is called from VBScript
I believe, only that class from executable jar will be called which contains main() method.
Below is the working syntax for VBScript calling jar file:
createobject("wscript.shell").run "java -jar vbcall.jar " & dbPassword & " CipherText ", 0, True
I am still wating for the response, on possibility of jar returning a String value?
It can't return a String. The only return value of the java executable is an integer (generally zero for successful completion, non-zero in case of error).
As someone has already suggested, what you can do is write a Java program that will write to stdout - using System.out.println() statements. So you need a way of capturing that output in your VBScript. I'm sure that's possible, though I've no idea how because I don't know VBScript. But a quick Google gives a few useful looking links, for example: http://www.codescript.co.uk/run_command_capture_output.htm.