How to launch programs on my hard disk when URLs are clicked?

D

dos-man 64

I'd like to create a webpage on my desktop with a bunch of hyperlinks.
When I click on a hyperlink I'd like to have a program file on my
computer launch. This isn't working.

Here is my example web page. This does not work.

<html>
<body>
<a href="file:///c:/program.exe arg1 arg2 arg3">Click here</a>
</body
</html>


Does anybody know why this does not work, or how it can be made to
work?

dos-man
 
B

Ben C

I'd like to create a webpage on my desktop with a bunch of hyperlinks.
When I click on a hyperlink I'd like to have a program file on my
computer launch. This isn't working.

Here is my example web page. This does not work.

<html>
<body>
<a href="file:///c:/program.exe arg1 arg2 arg3">Click here</a>
</body
</html>


Does anybody know why this does not work, or how it can be made to
work?

I don't think it can be made to work and I hope it can't. It would be a
big security problem-- you could click on a link that erased your hard
disk for example.
 
H

Harlan Messinger

dos-man 64 said:
I'd like to create a webpage on my desktop with a bunch of hyperlinks.
When I click on a hyperlink I'd like to have a program file on my
computer launch. This isn't working.

Here is my example web page. This does not work.

<html>
<body>
<a href="file:///c:/program.exe arg1 arg2 arg3">Click here</a>
</body
</html>


Does anybody know why this does not work, or how it can be made to
work?

Think about what would happen if you went to a website with a link
reading, "Click here for more information" and you did, and all of a
sudden all sorts of programs started executing on your machine without
your permission? Including, maybe, one that would start reformatting
your hard drive?

In any event, a Web URL is not a DOS command line. There's no reason to
expect that format to work in a context where a URL is expected. This
shouldn't be any more surprising than the fact that if you type

http://www.google.com/

at a DOS command prompt, the result won't be the Google's home page
appears in a browser on your screen.
 
A

Animesh K

dos-man 64 said:
I'd like to create a webpage on my desktop with a bunch of hyperlinks.
When I click on a hyperlink I'd like to have a program file on my
computer launch. This isn't working.

Here is my example web page. This does not work.

<html>
<body>
<a href="file:///c:/program.exe arg1 arg2 arg3">Click here</a>
</body
</html>


Does anybody know why this does not work, or how it can be made to
work?

dos-man

You need to use PHP with enough server side security implementations to
implement this kind of feature.
 
W

warm globe

dos-man 64 said:
I'd like to create a webpage on my desktop with a bunch of hyperlinks.
When I click on a hyperlink I'd like to have a program file on my
computer launch. This isn't working.

Here is my example web page. This does not work.

<html>
<body>
<a href="file:///c:/program.exe arg1 arg2 arg3">Click here</a>
</body
</html>


Does anybody know why this does not work, or how it can be made to
work?

dos-man

Open Download can open .exe's from Firefox, but use it with caution. It
actually saves the link to the Temp folder and runs it from there.

https://addons.mozilla.org/en-US/firefox/addon/207?application=firefox&id=207&vid=459
 
N

Neredbojias

I'd like to create a webpage on my desktop with a bunch of hyperlinks.
When I click on a hyperlink I'd like to have a program file on my
computer launch. This isn't working.

Here is my example web page. This does not work.

<html>
<body>
<a href="file:///c:/program.exe arg1 arg2 arg3">Click here</a>
</body
</html>


Does anybody know why this does not work, or how it can be made to
work?

dos-man

When you say 'on your desktop' I assume you mean locally and not online.

In general, it should work if your path is correct although some browsers
may refuse to open the exec and/or not identify the path for support files
like dll's and/or not take arguments correctly. So said, I tried it in ie6
(without arguments) and it opened Opera fine. Btw, most program files are
in a folder called "Program Files".
 
K

Kevin Darling

I'd like to create a webpage on my desktop with a bunch of hyperlinks.
When I click on a hyperlink I'd like to have a program file on my
computer launch. This isn't working.

You're asking in the wrong group. You need one of the Microsoft
scripting language groups. Like:

http://groups.google.com/group/microsoft.public.scripting.wsh/topics?hl=en&lr=&ie=UTF-8

In any case, yes, on a PC you can use a .hta file (HTML with a .hta
extension) and the WScript object. For a simple example, see:

http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct05/hey1031.mspx

Kev
 
S

scripts.contact

In any case, yes, on a PC you can use a .hta file (HTML with a .hta
extension) and the WScript object.


The WScript object is only available to WSH scripts not HTA.
 
D

dos-man 64

The WScript object is only available to WSH scripts not HTA.

Freaks. That's OK, I was really hoping that this could be done
without resorting to programming. How the hell does anybody who can't
program get anything done on PCs I'll never know. Based on what I have
seen, my guess is they don't :D

dos-man
 
D

dos-man 64

You need to use PHP with enough server side security implementations to
implement this kind of feature.- Hide quoted text -

- Show quoted text -

hmm... I briefly studied PHP, but I don't remember much about it. I'll
have to go back through the books and take a look at it. I was really
hoping that this could be done without resorting to programming. Oh,
well.

dos-man
 
J

Jonathan N. Little

dos-man 64 said:
Freaks. That's OK, I was really hoping that this could be done
without resorting to programming. How the hell does anybody who can't
program get anything done on PCs I'll never know. Based on what I have
seen, my guess is they don't :D

You can do it, just not "easily" from a webpage, thank God! You are just
trying to use the wrong tool. Screwdrivers make lousy hammers.
 
B

Bergamot

dos-man 64 said:
How the hell does anybody who can't
program get anything done on PCs I'll never know.

I don't get why you want a web page to run local programs in the first
place. Make plain old shortcuts for these programs and put them in the
Windows quick launch or start menu instead. Make a separate folder for
them if you want them isolated from other programs.

If you do this, they are still just a couple keystrokes or clicks away.
You can even keep the folder open on your desktop all the time, if
that's what you really want.
Based on what I have
seen, my guess is they don't :D

Use the right tool for the job. A web page, local or not, shouldn't
launch programs.
 
A

Animesh K

dos-man 64 said:
hmm... I briefly studied PHP, but I don't remember much about it. I'll
have to go back through the books and take a look at it. I was really
hoping that this could be done without resorting to programming. Oh,
well.

dos-man

By the way, I am unsure if php will run your windows applications. They
do run simple applications like mail, calendar, date, time, etc from
Linux. They also work well in handling database queries. But my
experience is limited to linux servers.
 
D

dos-man 64

I don't get why you want a web page to run local programs in the first
place. Make plain old shortcuts for these programs and put them in the
Windows quick launch or start menu instead. Make a separate folder for
them if you want them isolated from other programs.

If you do this, they are still just a couple keystrokes or clicks away.
You can even keep the folder open on your desktop all the time, if
that's what you really want.


Use the right tool for the job. A web page, local or not, shouldn't
launch programs.

I've really outgrown the standard methods of launching programs. I
just have too many programs and too many different sets of parameters
to pass to them at this point. The list will not be shrinking any time
soon. I created a killer launch pad quite a few years ago, but I've
outgrown even that. Right now I'm using an army of ms-dos batch files.
And they are all spread out in different folders all over the hard
drive. This is unacceptable.

I may not be able to use HTML for this, but I can simulate a web page
with Delphi. Labels can be used to simumlate hyperlinks. I started
working on it last night. No problems. I hate to have to resort to
programming every time I try to do something, but oh well that's
computers.

My thanks to the people in here for helping me out.

dos-man
 
K

Kevin Darling

Use the right tool for the job. A web page, local or not, shouldn't
launch programs.

Sometimes it is the right tool.

Before taking my three year old daughter on a trip overseas, I created
a set of HTML pages with large icons for playing movies, launching her
favorite games, etc. She was easily able to entertain herself.

Suggestions of using directories, etc, just wouldn't have had the same
ease of use.
 
K

Kevin Darling

The WScript object is only available to WSH scripts not HTA.

You're incorrect. You can instantiate it. Save the following as
an .hta file and start it with IE:

<html>
<script language="javascript">
function start()
{
var oShell = new ActiveXObject("WScript.Shell");
oShell.Run("notepad.exe c:\\test.txt");

}
</script>
<body>
<button onclick="start()">Start Notepad</button>
</body>
</html>

Cheers - Kev
 

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
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top