How to run an executable from a Web page

J

Johnny

How do I create a link on a Web page on my hard drive that will run an
executable file on my hard drive?

For example, let's say I create runpoodle.htm and save it to my hard
drive, and let's also say I have an executable file on the root of C
named c:\poodle.exe.

How can I create a link of some sort on runpoodle.htm that will run
poodle.exe on c:\ ?

Better yet, can I specify a data file that poodle.exe will open after it
starts?

I use Windows XP Pro, and when I create a simple href anything like this

<a href="file:\\c:\poodle.exe"> Run POODLE.EXE</a>

the result is that Windows opens a security warning box asking whether I
want to download poodle.exe.

If you need any other information, please let me know.

If this is not the appropriate newsgroup for this question, can you
suggest which ones I should try?

Thanks.

--Johnny
johnnyg aattssiiggnn kc.rr.com
 
K

kaeli

How do I create a link on a Web page on my hard drive that will run an
executable file on my hard drive?

Make an HTA.
(hypertext application)
Use the windows shell object to open anything you want and pass any params
you want.
Most examples on the net are in VBScript/WSH (windows script host). You can
use JScript or javascript if you want, but the examples are fewer and further
between.

HTAs are not subject to the restrictions of regular internet .html files.
They don't run in the internet security zone.

An HTA can be complicated, or it can just look like any other HTML file, but
with a .hta extension.

Here's a really simple one I had laying around from playing. It just opens
Excel.

testExcel.hta
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>Run Executable HTA</TITLE>
</HEAD>
<body bgcolor=#565656>
<script language="javascript" type="text/javascript">
var oShell = new ActiveXObject("WScript.Shell");
var prog = "C:\\Program Files\\Microsoft Office\\Office\\Excel.exe";
oShell.run ('"'+prog+'"',1);
window.close();
</script>
</BODY>
</HTML>

--
--
~kaeli~
Synonym: the word you use in place of a word you can't
spell.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
 
H

Hywel

How do I create a link on a Web page on my hard drive that will run an
executable file on my hard drive?

You can't.

If this is not the appropriate newsgroup for this question,

It probably isn't.

can you
suggest which ones I should try?

I doubt there are any. Think about this:
<a href="file://c/windows/system32/format c:">Home</a>
 
K

kaeli

You can't.

Sure you can.
There are a f-load of caveats about it, though.

The OP was talking about a page on his own computer to run a program resident
on his own computer. That's easy to do. See my post.
It is, however, not at all recommended for general internet use, nor is it
cross-browser or cross-platform.

--
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top