473,320 Members | 1,820 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,320 software developers and data experts.

Problems starting application on machine with HTML page

I would like to open an application from a hyperlink on a webpage.

1. the webpage is located on my local machine.
2. the application is located on my local machine.
3. the application will run on my local machine.

In other words... The WEB is really not involved.

What I have so far works with a Netscape Browser but what I really
need is for it to work in the IE browser or one that I will create
using
VB.net.

The code I have so far uses JAVAscript and some simple HTML code.

The code is as follows:

<html>
<head>
<title>Application launcher</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<script type="text/javascript">
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, args) {
if ((typeof path == 'string') && (path != '')) {
if ((Shell.MSIE) && (typeof Shell.$ == 'undefined')) {
/* If first time, try to instantiate ActiveX object
* for shell access:
*/
try {
Shell.$ = new ActiveXObject('WScript.Shell');
}
catch(e) {
Shell.$err(e.message);
return null;
}
}
/*
*/
if (Shell.MSIE) {
var arg = ((typeof args == 'string') && (args != '')) ?
(' "' + args + '"') : '';
var exe = '"'.concat(path, '"', arg);
try {
Shell.$.Run(exe);
}
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) ;
Shell.$.initWithPath(path);
if ((typeof args == 'string') && (args != '')) {
Shell._ = Components.classes['@mozilla.org/process/util;1'].
createInstance(Components.interfaces.nsIProcess);
Shell._.init(Shell.$);
Shell._.run(false, [args], 1);
}
else {
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', 'c:\
\netlog.txt'));">launch Notepad with netlog.txt</a><br>
<a href="javascript:void(Shell.run('c:\\windows\\note pad.exe', 'c:\
\myfile.txt'));">launch Notepad with myfile.txt</a><br>
</p>
</body>
</html>
I know I have some syntax problems but I am really stumped as to
where.

Any help would be appreciated.

Kevin

Apr 25 '07 #1
1 3383
ke*************@gmail.com wrote:
I would like to open an application from a hyperlink on a webpage.

1. the webpage is located on my local machine.
2. the application is located on my local machine.
3. the application will run on my local machine.

In other words... The WEB is really not involved.

What I have so far works with a Netscape Browser but what I really
need is for it to work in the IE browser or one that I will create
using
VB.net.
Hmmm this is comp.infosystems.www.authoring.html
^^^
Won't some Microsoft group be better suited?

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Apr 25 '07 #2

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

Similar topics

4
by: Phil Grimpo | last post by:
I had previously explained this problem in a different thread, but now that I have an IISState log, I figured I'd re-start the thred. My situation and the log are following... I have a very odd...
3
by: Indiana | last post by:
Situation: in an ASP page i have created i read a table and i display an ID from the table then i have a button and when i click on a run a new query and then the window has to be closed. (This...
5
by: Scott | last post by:
I have a customer that had developed an Access97 application to track their business information. The application grew significantly and they used the Upsizing Wizard to move the tables to SQL...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
4
by: Kristof Despiere | last post by:
Suppose you have one domain, filled with a couple of users. What needs to be done now is I need to start a windows application from a webform by pressing a button on the webform (for example). ...
12
by: Logan | last post by:
Hi, I am not a very experienced asp.net developer, but have a fair idea on how it works & better idea on vb.net. My requirement is to place an asp.net page on a website - which currently has...
1
by: Astera | last post by:
I seem to be having a problem using web parts after the beta 2 release. Any time I try to have the WebPartManager on any page, I get the exception listed below. I've gone through the steps listed...
3
by: Newbie | last post by:
Hi All Trying to create a mini-ASP web dev with a couple of PCs at school. When the teachers are happy with the site on the LAN then going to upload it to the school site. Problem is having...
0
by: senglory | last post by:
I wrote in web.config the following lines: <system.web> <customErrors mode="Off"/> </system.web>
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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)...
0
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...
0
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: 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.