Solved

Launch Ext App in Path Variable

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

759 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

21 Experts available now in Live!

Get 1:1 Help Now