?
Solved

Launch Ext App in Path Variable

Posted on 1998-09-02
1
Medium Priority
?
259 Views
Last Modified: 2010-05-18
I know how to launch an external application, just using the good old <HREF> link, but do you have to specify the complete path?  For example, if I want to create a link to ntoepad.exe- should it not launch if the windows directory is in the user's path varible?  Is there some way to do this?
0
Comment
Question by:2djohn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 140 total points
ID: 1270114
I would not attempt it - it seems not to work, possibly due to a separate command shell is started with no knowledge of the path...

Here is what is known:

For MSIE I would suggest you look really hard at Windows Scripting Host (WSH) at
http://www.microsoft.com/scripting/default.htm?/scripting/windowshost/default.htm

Example:
<script language="vbscript">
Set WshShell = CreateObject("WScript.Shell")
   Sub runlink_onClick()
      WshShell.Run "c:\\WINNT\\Explorer.exe c:\\WINNT", 1, 0
   End Sub
</script>

and in the page have <a name="runlink">Run</a>

You will get  

"An activex object on this page may be unsafe. Do you want to allow it to initialize and be accessed by scripts?"

when loading

One possibility is to use the PC Magazine programme WINCMD.  This
permits the launching of programmes from hyperlinks which target text
files.  The text files contain the launch command(s), and have a .wcm
extension which is associated with the WINCMD programme.  The WINCMD
programme ensures execution of the launch command(s).

Another is

Create a dos batch file that calls your program:

@echo off
C:\WINNT\Explorer C:\WINNT
exit

Set your link to the bat file.

If using NetScape, you'll have to define a Helper appl for the .bat
extension, perhaps command.com as a helper?


For just executing (probably without parameters - I had little time to dig out the old browsers you could do the following (Curtesy of JCS):

* 1 - setup the browser to accept running .exe instead of saving them:

-in N3, go the list of:

  Options|General prefs|Helper apps

In the list, locate and select "application/octet-stream", and set it up
with the "Launch application" action.

-in N4, go to:

  Edit|Preferences|Navigator|Applications

Then click on the "New type" button. Enter:

  Description: EXE file
  Extension  : exe
  MIME type  : application/exe
  Action     : "%1" %*

- There's nothing to add in E3.


* 2 - In your page, just have your link:

  <A HREF="file:///C:\WINDOWS\Calc.exe">file:///C:\WINDOWS\CALC.EXE</A>


* 3 - When you click the link:

- N3 will show you the default "Save as..." dialog box. Just click the
"Cancel" button, and Calc.exe will be launched.

- N4 will show you the "What do you want me to do with that file" dialog,
with options to open it or save it. Select "open" and click "OK". Calc.exe
will be launched.

- E3 will prompt you for action, then warn you it's unsecure to run an
unsigned exe file, then will launch calc.exe



0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question