Executing Programs Using Javascript

R

Rob V

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?
 
K

kaeli

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
-------------------------------------------------
 
R

Rob V

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?
 
G

GIMME

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>
 
R

Rob V

Thanks for the reply but still having the same problem with running
games this way. Explained in earlier post.

Any other ideas?
 
G

Grant Wagner

GIMME said:
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 <[email protected]>

* 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,093
Messages
2,570,607
Members
47,227
Latest member
bluerose1

Latest Threads

Top