473,322 Members | 1,538 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

launching a MS window that runs a .exe


I think I am asking the right newsgroup. If not maybe someone could
tell me where to ask this "beginner" question.

I want to click on an image (.jpg) that launches a Microsoft window
(cmd.exe or command.com) which executes some .exe, e.g googleearth.exe.
I know this is simple
for most of you but I am just starting XHTML. I think it begins with

<html>
<body>
<p>
An image as a hyperlink:

<a "???">

<!-- start Google Earth by clicking image -->

<img border="0"
src="ge.jpg"
width="32" height="32"/>
</a>
</p>
</body>
</html>

Thank you.

- Andrew M. Neiderer
USARL
Dec 1 '06 #1
10 3615
In article <J9********@arl.army.mil>,
ne******@osprey.arl.army.mil (Andrew Neiderer ) wrote:
I think I am asking the right newsgroup. If not maybe someone could
tell me where to ask this "beginner" question.

I want to click on an image (.jpg) that launches a Microsoft window
(cmd.exe or command.com) which executes some .exe, e.g googleearth.exe.
I know this is simple
for most of you but I am just starting XHTML. I think it begins with
You can't start applications directly. What you need to do is provide
the user with a document that opens the application indirectly.

For example, to launch Google Earth, your link should point to a KML
file. If Google Earth is installed and the user's browser is set up
correctly, the KML file will be passed to Google Earth by the browser.

More info here: http://earth.google.com/kml/kml_tut.html

--
If you really must contact me by email, visit
http://rumkin.com/tools/compression/base64.php
and decode the following string of characters:
RW1haWw6IHBoaWxyb25hbkBibHVleW9uZGVyLmNvLnVr
Dec 1 '06 #2

Andrew Neiderer wrote:
I want to click on an image (.jpg) that launches a Microsoft window
(cmd.exe or command.com) which executes some .exe, e.g googleearth.exe.
It's not possible. If it were possible, that would be a major bug and
would need to be fixed immediately in that browser.

Maybe your page just starts Google earth and is safe. How would you
distinguish this from my page, which is Evil and starts "format c:/"
instead? You see the problem, for why web browsers _can't_be_
permitted to escalate privileges from merely display documents to
starting programs.

There are ways around this. One way would be to embed an executable
ActiveX control on the page and allow that to run with serious
privileges. Then how do you prove the ActiveX control itself is safe
and trustworthy? There's still no widespread consensus on how to do
this reliably and flexibly which is why ActiveX hasn't ever taken the
web by storm.

Dec 1 '06 #3
Andy Dingley wrote:
There are ways around this. One way would be to embed an executable
ActiveX control on the page and allow that to run with serious
privileges.
I'd like to be able to run an executable via a link in a browser on our
intranet. Do you have any leads on where I might find an activex
control such as you mention?

Thanks, Peter
Dec 6 '06 #4

Pete wrote:
I'd like to be able to run an executable via a link in a browser on our
intranet. Do you have any leads on where I might find an activex
control such as you mention?
If you're after Google Earth, then the best way is probably a link to a
..kmz file. You can get users to set permissions on .kmz files to be
quite generous and to open GE automatically. There'll be a certain
amount of per-user config to do for each browser though.

Dec 6 '06 #5
Andy Dingley wrote:
Pete wrote:
>I'd like to be able to run an executable via a link in a browser on our
intranet. Do you have any leads on where I might find an activex
control such as you mention?

If you're after Google Earth, then the best way is probably a link to a
.kmz file.
Thanks, Andy, but what I'd like to be able to do is run an arbitrary
..exe file. In this particular case, it would be our "Customer
Relationship Management" program, but I'm interested in a general
purpose solution.

Peter
Dec 6 '06 #6
In article <45**************@pobox.com>, Pete <pj*****@pobox.com>
wrote:
Andy Dingley wrote:
Pete wrote:
I'd like to be able to run an executable via a link in a browser on our
intranet. Do you have any leads on where I might find an activex
control such as you mention?
If you're after Google Earth, then the best way is probably a link to a
.kmz file.

Thanks, Andy, but what I'd like to be able to do is run an arbitrary
.exe file. In this particular case, it would be our "Customer
Relationship Management" program, but I'm interested in a general
purpose solution.
The same principle applies - provide a link to a file which is
associated with your CRM application.
Dec 7 '06 #7
David Stone wrote:
In article <45**************@pobox.com>, Pete <pj*****@pobox.com>
wrote:
>Andy Dingley wrote:
Pete wrote:

I'd like to be able to run an executable via a link in a browser on our
intranet. Do you have any leads on where I might find an activex
control such as you mention?

If you're after Google Earth, then the best way is probably a link to a
.kmz file.

Thanks, Andy, but what I'd like to be able to do is run an arbitrary
.exe file. In this particular case, it would be our "Customer
Relationship Management" program, but I'm interested in a general
purpose solution.

The same principle applies - provide a link to a file which is
associated with your CRM application.
I've tried this, and it's just not practical. I'm not sure of exactly
what happens (does Windows load the entire 168Mb data file into memory
first, before looking for the association?), but it takes over 30
seconds (yes, I've timed it - my workmates didn't believe it either) for
the program to load. To the users, it appears that nothing happens. So
they click again, and again, then curse a few times, click again, go
have a coffee, and when they get back, the application is open.

What I'm looking for is a way of just running any arbitrary .exe file.
Does anyone know of a way to do this?

One of the replies to the original poster stated that it could be done
with an activex control, but I've searched and haven't been able to find
one. Was the poster just saying that technically it would be possible,
rather than that someone had actually done it and here's the link to or
name of the control?

Peter
Dec 7 '06 #8
Pete <pj*****@pobox.comwrites:
David Stone wrote:
>In article <45**************@pobox.com>, Pete <pj*****@pobox.com>
wrote:
>>Andy Dingley wrote:
Pete wrote:
I'd like to be able to run an executable via a link in a
browser on our
intranet. Do you have any leads on where I might find an activex
control such as you mention?
If you're after Google Earth, then the best way is probably a
link to a
.kmz file.
Thanks, Andy, but what I'd like to be able to do is run an
arbitrary .exe file. In this particular case, it would be our
"Customer Relationship Management" program, but I'm interested in a
general purpose solution.
The same principle applies - provide a link to a file which is
associated with your CRM application.

I've tried this, and it's just not practical. I'm not sure of exactly
what happens (does Windows load the entire 168Mb data file into memory
first, before looking for the association?), but it takes over 30
seconds (yes, I've timed it - my workmates didn't believe it either)
for the program to load. To the users, it appears that nothing
happens. So they click again, and again, then curse a few times,
click again, go have a coffee, and when they get back, the application
is open.

What I'm looking for is a way of just running any arbitrary .exe
file. Does anyone know of a way to do this?
I never thought I'd be answering this type of question so let me add a
couple of caveats: I do not know much about Windows and this kind of
thing of thing is only safe in a tightly controlled intranet
environment (hence it is not really a valid www.authoring question).

This is what I would do on a GNU/Linux system. If the CRM application
needs to be run on "huge_file.data", I would write a small file that
contains a reference to the data, e.g.:

"huge_file.crm" containing:
http://my.server.org/huge_file.data

and arrange for .crm files to be served as a distinct MIME type (a
small edit to the server config). On client machines, this MIME type
is associated with an equally tiny wrapper script that takes the reference
and feeds it to the crm program. Of course, this is only possible for
applications that are generous about how they takes input or data
(Linux program often are) and requires some control of both server and
client machines.

--
Ben.
Dec 8 '06 #9
Pete wrote:
David Stone wrote:
>In article <45**************@pobox.com>, Pete <pj*****@pobox.comwrote:
>>Andy Dingley wrote:
Pete wrote:
I'd like to be able to run an executable via a link in a browser
on our
intranet. Do you have any leads on where I might find an activex
control such as you mention?
If you're after Google Earth, then the best way is probably a
link to a
.kmz file.

Thanks, Andy, but what I'd like to be able to do is run an arbitrary
.exe file. In this particular case, it would be our "Customer
Relationship Management" program, but I'm interested in a general
purpose solution.

The same principle applies - provide a link to a file which is
associated with your CRM application.

I've tried this, and it's just not practical. I'm not sure of exactly
what happens (does Windows load the entire 168Mb data file into memory
first, before looking for the association?)
It doesn't. Windows only knows the name that's given, and it doesn't
even check it for either validity or existence. Only the application
knows what the application plans to do with the file, or how it intends
to react if the file doesn't exist, so Windows isn't in a position to do
anything with it.
Dec 8 '06 #10
VK

Pete wrote:
What I'm looking for is a way of just running any arbitrary .exe file.
Does anyone know of a way to do this?

One of the replies to the original poster stated that it could be done
with an activex control, but I've searched and haven't been able to find
one. Was the poster just saying that technically it would be possible,
rather than that someone had actually done it and here's the link to or
name of the control?
A few notes (see the source at the bottom):

1) obviously the script will not work (will show "Security exception"
alert) within the default sandbox.

2) a phychological drawback of it is that IE's end users in your
company may get accustomed to see security warning dialog AND press Yes
in it (while the mantra should be "simply say no"). Thus it is highly
suggested to eliminate the security warning step by adjusting intranet
settings.

3) if you are copying the source over Google Groups be aware that
Google james strings with at-sign in it (must be an e-mail protection
mesure?). In the particular the string:
Components.classes['@mozilla.org/file/local;1']
has to be
Components.classes['at-sign and the rest

4) this script works for IE 5.0 or higher and for any Gecko-based
browser (including Firefox of course).

5) Don't forget that backslash in Windows path is the escape character
in javascript: so always double it: c:\\windows\\notepad.exe

6) Enjoy! :-)
<html>
<head>
<title>Exe</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<script type="text/javascript">
/*
Copyright (c) 2005 VK [schools_ring_at_yahoo.com]
Permission is hereby granted, free of charge, to any person obtaining
a copy
of this software and associated documentation files (the "Software"),

to deal in the Software without restriction, including without
limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or
sell copies of the Software, and to permit persons to whom the
Software is furnished
to do so, subject to the following conditions:</p>
The above copyright notice and this permission notice shall be
included in
all copies or substantial portions of the Software.</p>
THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY
KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY

CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

var Shell = {
'$err' : function(m) {
var msg = m || 'Security exception';
window.alert('[Shell] script object\n\n' + msg);
}
, 'MSIE' : ( (typeof window != 'undefined')
&& (typeof window.ActiveXObject != 'undefined'))
, 'Gecko' : ( (typeof window != 'undefined')
&& (typeof window.netscape != 'undefined')
&& (typeof window.netscape.security != 'undefined')
/* that Opera... always pretending to do everything
* everywhere but not really doing anything of it...
*/
&& (typeof window.opera != 'object'))
, 'run' : function(path) {
if ((typeof path == 'string') && (path != '')) {
if ((Shell.MSIE) && (typeof Shell.$ == 'undefined')) {
try {Shell.$ = new ActiveXObject('WScript.Shell');}
catch(e) {Shell.$err(e.message);}
}
if (Shell.MSIE) {
try {Shell.$.Run(path);}
catch(e) {Shell.$err(e.message);}
}
else if (Shell.Gecko) {
/* Netscape security model grants privileges
* on the per-call per-context basis; thus
* privilege request and privilege usage
* have to be in the same block.
*/
try {
netscape.security.PrivilegeManager.
enablePrivilege('UniversalXPConnect');
Shell.$ = Components.classes['@mozilla.org/file/local;1'].
createInstance(Components.interfaces.nsILocalFile) ;
/* NOTE: initWithPath has problems on MacOS and other OSes
* which do not represent file locations as paths.
* If you do use this function, be very aware of this problem!
*/
Shell.$.initWithPath(path);
Shell.$.launch();
}
catch(e) {
Shell.$err(e.message);
}
}
else {
Shell.$err('not supported on this platform');
}
}
else {
Shell.$err('Invalid argument');
}
}
};
</script>
</head>
<body>
<p>
<a
href="javascript:void(Shell.run('c:\\windows\\note pad.exe'));">Launch
Notepad</a>
</p>
</body>
</html>

Dec 8 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Patrick L. Nolan | last post by:
I'm trying to find a clean way to launch a Wordpad editor on Windows. By "clean", I mean that it should work on as many versions of Windows as possible, and it shouldn't require installing any...
2
by: Terry | last post by:
When launching our application with Internet Explorer already opened, but not pointing to our web server, the session variables disappear. If you open I.E. after launching our app, it works fine....
1
by: billster | last post by:
Hi, I am trying to launch a new browser with the same url location as the current browser, and at the same time run some javascript. This works with <a...
3
by: Mark | last post by:
Hi All I'm building some database queries that send reports in HTML format via e-mail. One of the fields in the report is the name of a customer activity log (which is a specially formatted text...
6
by: JerryP | last post by:
Hello, is there a way to launch the property dialogue for a directory from my c# app ? I would also like to launch the User Account Properties from Active Directory Users and Computers, and the...
2
by: James N | last post by:
PROBLEM # 1: ----------------- I am trying to launch a website in IE on the server from a C#/ASP.NET web service. I am using the System.Diagnostics namespace and the Process class methods. The...
2
by: VJ | last post by:
I have the option "Reuse windows for launching shortcuts" checked in my IE. Now in my client code on a click event of a link, I do the following, Dim procWebPages As Process Dim strWebPageLink...
8
by: Keith French | last post by:
I am trying to launch an external program within Visual Basic 2005 Express. If it is a simple program it works well with:- myProg = "C:\MyFolder\MyApp.exe"...
10
by: Simon Verona | last post by:
I've decided to store my help pages on a web site rather than deliver with my application (trying to reduce the size of the install files). The web site is sort of all ready to rock and roll. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.