Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > How to run an executable from a Web page

Reply
Thread Tools

How to run an executable from a Web page

 
 
Johnny
Guest
Posts: n/a
 
      10-13-2004
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


 
Reply With Quote
 
 
 
 
kaeli
Guest
Posts: n/a
 
      10-13-2004
In article <yYbbd.11845$(E-Mail Removed)-kc.rr.com>, http://www.velocityreviews.com/forums/(E-Mail Removed)
enlightened us with...
> 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

 
Reply With Quote
 
 
 
 
Hywel
Guest
Posts: n/a
 
      10-13-2004
In article <yYbbd.11845$(E-Mail Removed)-kc.rr.com>, Johnny says...
> 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>

--
Hywel

http://sponsorhywel.org.uk/
 
Reply With Quote
 
kaeli
Guest
Posts: n/a
 
      10-13-2004
In article <(E-Mail Removed)> ,
(E-Mail Removed) enlightened us with...
> In article <yYbbd.11845$(E-Mail Removed)-kc.rr.com>, Johnny says...
> > 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.
>


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.

--
--
~kaeli~
Never say, "Oops!"; always say, "Ah, interesting!"
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Create executable from executable with py2exe vedrandekovic@gmail.com Python 0 03-29-2008 12:23 PM
Running an Executable Before Executable JAR Jason Cavett Java 8 05-16-2007 07:14 PM
what is fast dynamically linked executable or statically linked executable ?how to decide? pratap C Programming 20 03-07-2007 04:46 AM
How can I run a c executable in pwd ,while the executable is in some other directory vishsid3@gmail.com C Programming 15 08-21-2006 06:04 AM



Advertisments