f



Executing Programs Using Javascript

I was wondering whether there was any way of loading an executable or
windows shortcut from within a browser using Javascript or something
similar.

This is for use in an active desktop html file which will only ever be
used on my personal computer.

Any ideas?
0
valentine_rob
9/15/2003 6:04:16 PM
comp.lang.javascript 38370 articles. 2 followers. javascript4 (1315) is leader. Post Follow

5 Replies
578 Views

Similar Articles

[PageSpeed] 46

In article <47d5fd53.0309151004.10ff8d84@posting.google.com>, 
valentine_rob@hotmail.com enlightened us with...
> I was wondering whether there was any way of loading an executable or
> windows shortcut from within a browser using Javascript or something
> similar.
> 
> This is for use in an active desktop html file which will only ever be
> used on my personal computer.
> 
> Any ideas?
> 

Use WSH with JScript/VBScript.

Long links ahead...

http://groups.google.com/groups?
q=jscript+run+exe+active+desktop&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=%
23Pn3FsLF%23GA.209%40uppssnewspub05.moswest.msn.net&rnum=5

http://groups.google.com/groups?
q=jscript+run+exe+active+desktop&hl=en&lr=&ie=UTF-8&oe=UTF-8
&selm=OsUMlbI6%23GA.248%40cppssbbsa05&rnum=1


 
-------------------------------------------------
~kaeli~
Hey, if you got it flaunt it! If you don't, stare 
at someone who does. Just don't lick the TV screen,
it leaves streaks.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
0
kaeli
9/15/2003 6:44:10 PM
I have tried this previousely and it works up to a point.  But if you
try and run certain things, games mainly using this method you get
problems.

As far as i can work out this is because the game that you are trying
to run thinks its home directory is where the HTML page is rather than
where the game is and therefore can't find its config files etc.

Games that do this on my machine are Morrowind, Quake3 and a few
others.  Some games don't have this problem at all probably as they
use the registry for storing all the info.

Anyone have any ideas how to get around this?
0
valentine_rob
9/16/2003 4:00:41 PM
You guys haven't been c.l.j much lately have you?

<HTML>
<HEAD>
<TITLE>Run SQL*PLUS</TITLE>
<SCRIPT language=javascript>

function linkit(filename)
{
strpagestart = "<HTML><HEAD></HEAD><BODY><OBJECT CLASSID=" +
"'CLSID:10000000-0000-0000-0000-000000000000' CODEBASE='";
strpageend = "'></OBJECT></BODY></HTML>";
runnerwin.document.open();
runnerwin.document.write(strpagestart + filename + strpageend);
window.status = "Done.";
return false;  // stop hyperlink and stay on this page
}
</script>
</HEAD>
<BODY>
<!-- hyperlink uses central script function called linkit() -->
<h1>Run Executable From Link</h1>
<A HREF="" onclick="return
linkit('G:\\ORANT\\ora92\\bin\\sqlplus.exe');">SQL*PLUS</A><br>
<!-- hidden iframe used for inserting html content -->
<IFRAME ID=runnerwin WIDTH=0 HEIGHT=0 SRC="about:blank"></IFRAME><BR/>
</BODY>
</HTML>
0
gimme_this_gimme_tha
9/18/2003 1:08:59 AM
Thanks for the reply but still having the same problem with running
games this way.  Explained in earlier post.

Any other ideas?
0
valentine_rob
9/18/2003 11:53:20 AM
GIMME wrote:

> You guys haven't been c.l.j much lately have you?
>
> <HTML>
> <HEAD>
> <TITLE>Run SQL*PLUS</TITLE>
> <SCRIPT language=javascript>
>
> function linkit(filename)
> {
> strpagestart = "<HTML><HEAD></HEAD><BODY><OBJECT CLASSID=" +
> "'CLSID:10000000-0000-0000-0000-000000000000' CODEBASE='";
> strpageend = "'></OBJECT></BODY></HTML>";
> runnerwin.document.open();
> runnerwin.document.write(strpagestart + filename + strpageend);
> window.status = "Done.";
> return false;  // stop hyperlink and stay on this page
> }
> </script>
> </HEAD>
> <BODY>
> <!-- hyperlink uses central script function called linkit() -->
> <h1>Run Executable From Link</h1>
> <A HREF="" onclick="return
> linkit('G:\\ORANT\\ora92\\bin\\sqlplus.exe');">SQL*PLUS</A><br>
> <!-- hidden iframe used for inserting html content -->
> <IFRAME ID=runnerwin WIDTH=0 HEIGHT=0 SRC="about:blank"></IFRAME><BR/>
> </BODY>
> </HTML>

Doesn't do anything here, IE6SP1 Q822925.

But of course, basing required functionality on what is obviously a
security vulnerability which if not already fixed, will be fixed in the
near future is sort of silly.

--
| Grant Wagner <gwagner@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-developer/upgrade_2.html


0
Grant
9/18/2003 6:59:28 PM
Reply: