Solved

Launch Ext App in Path Variable

Posted on 1998-09-02
1
253 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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-…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now