F
forum7
I need some immediate guidance with an error I am facing using an
ActiveXObject to instantiate a DLL and use the object to launch a
command on the local client. I use this great DLL called LaunchinIE
which works for the most part. But I am running into a hurdle in my
application, as described below...
I have set up an ASP page with the following code on the web server:
<html>
<head>
<title>Testing Application Launch In IE</title>
<script language="JavaScript">
function launchApp(strCmdLine)
{
var obj = new ActiveXObject("LaunchinIE.Launch");
obj.LaunchApplication(strCmdLine);
}
</script>
</head>
<body>
<script language="JavaScript">
var qt = '"';
var strCmdLine = 'C:\\ddc32\\ddc32.exe ';
strCmdLine += 'ddc(dsp(30, Application Login, Logging in to
Application..., 3) if w4w(2, Missing Client ID) else if w4i(40,GenQL,)
wait(6) skw(0,GenQL TSTUSER{enter}TSTPWD{enter}) endif endif dsp()) &&
';
strCmdLine += qt+'C:\\Program Files\\GenQL\\genql.exe'+qt + ' ';
strCmdLine += 'GenQL.App Name=Desktop70';
launchApp(strCmdLine);
</script>
</body>
</html>
On the client system, I registered the launchinIE.dll component that
suppresses the IE security prompt for opening or saving an executable.
Now, when I try to access this page from the client, the first part of
the command works, i.e. the ddc32 winbatch executable. But the second
part of the command is not recognized and a message box shows up
stating that the command is unknown.
Surprisingly, if I try the exact two commands from the DOS command
line, i.e.
C:\ddc32\ddc32.exe ddc(dsp(30, Application Login, Logging in to
Application..., 3) if w4w(2, Missing Client ID) else if w4i(40,GenQL,)
wait(6) skw(0,GenQL TSTUSER{enter}TSTPWD{enter}) endif endif dsp()) &&
"C:\Program Files\GenQL\genql.exe" GenQL.App Name=Desktop70
.... both commands are executed in sequence and work just fine. Since
the command is included in JavaScript, I had to escape the reverse
slash and alias the double quote character with a variable "qt". Also,
the && is more like Unix, where the result of the first command
decides whether or not to execute the second command. In other words,
if the first command returns TRUE, the second command is executed only
then. I know your DLL works just fine, because if I replace this long
command with something simpler like...
C:\ddc32\display1.bat ashwin && C:\ddc32\display2.bat raj
.... it works just fine. I feel this may be a JavaScript type of issue,
and it is somehow unable to parse the argument to the first command
ddc32, thereby failing the second command.
I greatly appreciate any help!
ActiveXObject to instantiate a DLL and use the object to launch a
command on the local client. I use this great DLL called LaunchinIE
which works for the most part. But I am running into a hurdle in my
application, as described below...
I have set up an ASP page with the following code on the web server:
<html>
<head>
<title>Testing Application Launch In IE</title>
<script language="JavaScript">
function launchApp(strCmdLine)
{
var obj = new ActiveXObject("LaunchinIE.Launch");
obj.LaunchApplication(strCmdLine);
}
</script>
</head>
<body>
<script language="JavaScript">
var qt = '"';
var strCmdLine = 'C:\\ddc32\\ddc32.exe ';
strCmdLine += 'ddc(dsp(30, Application Login, Logging in to
Application..., 3) if w4w(2, Missing Client ID) else if w4i(40,GenQL,)
wait(6) skw(0,GenQL TSTUSER{enter}TSTPWD{enter}) endif endif dsp()) &&
';
strCmdLine += qt+'C:\\Program Files\\GenQL\\genql.exe'+qt + ' ';
strCmdLine += 'GenQL.App Name=Desktop70';
launchApp(strCmdLine);
</script>
</body>
</html>
On the client system, I registered the launchinIE.dll component that
suppresses the IE security prompt for opening or saving an executable.
Now, when I try to access this page from the client, the first part of
the command works, i.e. the ddc32 winbatch executable. But the second
part of the command is not recognized and a message box shows up
stating that the command is unknown.
Surprisingly, if I try the exact two commands from the DOS command
line, i.e.
C:\ddc32\ddc32.exe ddc(dsp(30, Application Login, Logging in to
Application..., 3) if w4w(2, Missing Client ID) else if w4i(40,GenQL,)
wait(6) skw(0,GenQL TSTUSER{enter}TSTPWD{enter}) endif endif dsp()) &&
"C:\Program Files\GenQL\genql.exe" GenQL.App Name=Desktop70
.... both commands are executed in sequence and work just fine. Since
the command is included in JavaScript, I had to escape the reverse
slash and alias the double quote character with a variable "qt". Also,
the && is more like Unix, where the result of the first command
decides whether or not to execute the second command. In other words,
if the first command returns TRUE, the second command is executed only
then. I know your DLL works just fine, because if I replace this long
command with something simpler like...
C:\ddc32\display1.bat ashwin && C:\ddc32\display2.bat raj
.... it works just fine. I feel this may be a JavaScript type of issue,
and it is somehow unable to parse the argument to the first command
ddc32, thereby failing the second command.
I greatly appreciate any help!