Re: Launch chm file on WS within HTML
From: Ray Hinse (rhinse_at_comcast.net)
Date: 03/21/04
- Next message: Al Dunbar [MS-MVP]: "Re: Automatically login a user from 'at'"
- Previous message: Chris \( Val \): "Re: Launch chm file on WS within HTML"
- In reply to: Chris \( Val \): "Re: Launch chm file on WS within HTML"
- Next in thread: Chris \( Val \): "Re: Launch chm file on WS within HTML"
- Reply: Chris \( Val \): "Re: Launch chm file on WS within HTML"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 21 Mar 2004 14:03:06 GMT
Interestingly enough, I had already tried the backslash escape character
in several combinations all to no avail. At your suggestion, I have used
the recommended string noted below in a slightly altered script.
<script language="JScript">
function Launch() {
var sExec = "\"c:\WSH Script\TechNet Script Center\scriptcenter.chm\"";
var oShell = new ActiveXObject("WScript.Shell");
oShell.run (sExec, 1);
var oShell = 0;
}
</script>
When I first click the 'Clickme' button I get the error:
The system cannot find the file spedified.
However, if I click 'Click me' once again, the program launches.
Oddly enough, I had to remove the [bWaitOnReturn] value of False. I kept
getting an error 'False is undefined' and the script would not run at all.
You'll also notice that 'CreateObject' in VBS has been replaced with
'new ActiveXObject' which is apparently the only way it will work in JScript.
If you have any further suggestions, I am all ears and sincerely hope that I
have not 'worn out my welcome' in what must appear to be an obsessive pursuit.
Cheerio & many thanks,
Ray
"Chris ( Val )" <chrisval@bigpond.com.au> wrote in message
news:c3joet$23v4k9$1@ID-110726.news.uni-berlin.de...
> Hi Ray.
>
> In VB or VBScript, we use an additional double quote to
> escape another. However, in Java Script, the rules are
> a little different in terms of what character to use to
> escape another. In this case, I you want to use the
> backslash escape character before backslash '\'(path
> separator, as well as the double quote to make the whole
> thing one complete argument). For example:
>
> oShell.run """c:\WSH Script\TechNet Script Center\scriptcenter.chm"""
>
> The above would now become:
>
> oShell.run( "\"c:\\WSH Script\\TechNet Script Center\\scriptcenter.chm\"" );
>
> The interpreter now sees this as:
>
> "c:\WSH Script\TechNet Script Center\scriptcenter.chm"
>
> The backslash character is commonly used in C and C++ as well as
> Java, for exactly thes kind of situation(s).
>
> Cheers.
> Chris Val
- Next message: Al Dunbar [MS-MVP]: "Re: Automatically login a user from 'at'"
- Previous message: Chris \( Val \): "Re: Launch chm file on WS within HTML"
- In reply to: Chris \( Val \): "Re: Launch chm file on WS within HTML"
- Next in thread: Chris \( Val \): "Re: Launch chm file on WS within HTML"
- Reply: Chris \( Val \): "Re: Launch chm file on WS within HTML"
- Messages sorted by: [ date ] [ thread ]