I'm having some problems launching a VBscript from within a Java program under Windows. I get the following in my log file:
Essentially i'm trying to launch the VBscript (which requires an argument - the TXT filename) via 'wscript.exe'. I'll have to check if I am permitted to publish the code snippet as it's a sensitive project. However, I was hoping someone could either shed some light on how to launch a Windows program from within Java and/or the meaning of 'error=2'. I have a feeling that it is related to a 'file not found' type of error but the VBS file definitely exists. My VBS script takes the argument supplied to it and creates a file for output from that argument. Perhaps the Java program is unable to decode the path to wscript.exe as I have used an environment variable to locate the Windows system root directory? Or could it be the backslashes in the path?Code:#Wed May 28 16:37:27 BST 2008 Event 26910: java.io.IOException: CreateProcess: %SystemRoot%\System32\wscript.exe "D:\Program Files\xxx\abc.vbs" "D:\Program Files\xxx\abc.vbs.txt" error=2
I have quoted the vbscript file and its argument as these contain spaces. The command runs find from a DOS prompt.


LinkBack URL
About LinkBacks
Reply With Quote