I want to run a simple java programme with parsing arguments using VB Scripts.
this is my VBScript code
Sub Button1_Click()
Set WshShell = CreateObject("WScript.Shell")
Dim jar
Dim location
Dim dictionary
Set dictionary = CreateObject("Scripting.Dictionary")
jar = "C:\Users\Documents\ExP.jar"
location = "C:\Users\Documents\TestProject"
Set WshShellExec = WshShell.Exec("java -jar " & Chr(34) & jar & Chr(34) & location & Chr(34))
End Sub
This is my java class which I want to pass arguments
public static void main(String[] args) {
ReadTestScripts readTestScripts = new ReadTestScripts(args[3]);
//location ="C:\\Users\\Documents\\TestProject" - want to pass this path to java programme
readTestScripts.showResult();
}
I didn't get the expected output when I pass the location as VBScript argument