Hey guys,
I am new to this forum and working with VBScript and Java for last 8 months.
I am getting 'permission denied' message from WshShell.Run() while trying to execute the raw command but still I am getting return code 0. If I stored all those same instructions in a batch file and run that batch file using WshShell.Run(), my program is working fine and giving me expected output.
This left me in a confused state. Inside the batch file I'm trying to execute a Java class. If that invocation is successful then only I should get a RC 0 but why I am getting RC 0 inspite of 'permission denied' message.
My code is something like:
cmd=<contains all DLL/JAR path and executes a Java class>
rc = WshShell.Run(cmd, 0, true) ----this is giving me permission denied message
But if I changed it to:
var a = fso.CreateTextFile(GetPath() + "test.bat", true);
a.WriteLine(cmd);
a.Close();
rc = WshShell.Run(test.bat, 0, true) ----this one is running fine
My questions are:
why I am getting permission denied while executing the commands directly?
why I am getting RC 0 inspite of Java class execution failure?
is there any difference these two kind of invokes? I am running this code under domain user a/c NOT under local system a/c and that a/c has admin access to ALL resources.
I am new to this forum and working with VBScript and Java for last 8 months.
I am getting 'permission denied' message from WshShell.Run() while trying to execute the raw command but still I am getting return code 0. If I stored all those same instructions in a batch file and run that batch file using WshShell.Run(), my program is working fine and giving me expected output.
This left me in a confused state. Inside the batch file I'm trying to execute a Java class. If that invocation is successful then only I should get a RC 0 but why I am getting RC 0 inspite of 'permission denied' message.
My code is something like:
cmd=<contains all DLL/JAR path and executes a Java class>
rc = WshShell.Run(cmd, 0, true) ----this is giving me permission denied message
But if I changed it to:
var a = fso.CreateTextFile(GetPath() + "test.bat", true);
a.WriteLine(cmd);
a.Close();
rc = WshShell.Run(test.bat, 0, true) ----this one is running fine
My questions are:
why I am getting permission denied while executing the commands directly?
why I am getting RC 0 inspite of Java class execution failure?
is there any difference these two kind of invokes? I am running this code under domain user a/c NOT under local system a/c and that a/c has admin access to ALL resources.