Smart_boy
06-20-2008, 02:09 AM
Hi all,
I use the .hta to run my javascript code. But there shown an error to the script. I don't know what happen to my script. Please help to check.
I'm newbie for the javascript. Hope can get a help from you all. Thanks!
My error part of the javascript is show as below:
var WScript = new Object();
var WScript.Arguments = new ActiveXObject("WScript.Shell");
if (WScript.Arguments.Length >= 1) {
Application = WScript.Arguments(0);
Arguments = "";
for (Index = 1; Index < WScript.Arguments.Length; Index += 1) {
if (Index > 1) {
Arguments += " ";
}
Arguments += WScript.Arguments(Index);
}
new ActiveXObject("Shell.Application").ShellExecute(Application, Arguments, "", "runas");
}
else {
WScript.Echo("Usage:");
WScript.Echo("elevate Application Arguments");
}
}
The error message is shown as below:
An error has occurred in the script of this page
Line: 70
Char: 1
Error: 'Argument.Length' is not null or an object
Code: 0
URL: file:C:/Users/Install/autorun/setup.hta
Thank you!
I use the .hta to run my javascript code. But there shown an error to the script. I don't know what happen to my script. Please help to check.
I'm newbie for the javascript. Hope can get a help from you all. Thanks!
My error part of the javascript is show as below:
var WScript = new Object();
var WScript.Arguments = new ActiveXObject("WScript.Shell");
if (WScript.Arguments.Length >= 1) {
Application = WScript.Arguments(0);
Arguments = "";
for (Index = 1; Index < WScript.Arguments.Length; Index += 1) {
if (Index > 1) {
Arguments += " ";
}
Arguments += WScript.Arguments(Index);
}
new ActiveXObject("Shell.Application").ShellExecute(Application, Arguments, "", "runas");
}
else {
WScript.Echo("Usage:");
WScript.Echo("elevate Application Arguments");
}
}
The error message is shown as below:
An error has occurred in the script of this page
Line: 70
Char: 1
Error: 'Argument.Length' is not null or an object
Code: 0
URL: file:C:/Users/Install/autorun/setup.hta
Thank you!