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
Solved

Launch Ext App in Path Variable

Posted on 1998-09-02
1
255 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
1 Comment
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 70 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…

808 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