Solved

Launch EXE from client machine

Posted on 2004-08-11
5
761 Views
Last Modified: 2008-03-10
I have a web page where we have a need to run an EXE from client's machine. The code I already have is this:

<a href="javascript:LaunchApp()">Launch Client EXE</a>

<script>
     function LaunchApp() {
          var ws = new ActiveXObject("WScript.Shell");
          ws.Exec("C:\\Program Files\\Microsoft Office\\Office10\\WINWORD.EXE");
     }
</script>

This code works perfect on my machine, however it does not work at all on others. The error they receive is: "Automation server can't create object".
The WScript.exe is installed on all machines. All have the same version 5.6.

Am I missing somethign? Are there other things I need to be aware of or check to make sure that this works? Or maybe there is a better solution? Any of these will do. Thanks

0
Comment
Question by:rtarna
  • 2
  • 2
5 Comments
 
LVL 3

Expert Comment

by:topless_stang
ID: 11779751
My guess would be that when you say "This code works perfect on my machine" - you are actually hosting the .htm (or .asp) file on your machine.

For protection from mal-ware, browsers prevent hard-drive access when the page is from an untrusted source.  If you load the page from your machine, the source is trusted, but once on IIS or a network share - it is not trusted by default.  To remedy this, you'll need to add the network server to the list of trusted sites on each client machine.  Much easier if you have Active Directory

To prove this, I tried your code in c:\temp.htm vs \\127.0.0.1\c$\temp.htm - from c:\temp no problems, but from 127.0.0.1 I got the same error until I added it to my trusted sites, then no problem (except for the note from IE that an ActiveX control is trying to interact...).

Hope this helps,
0
 

Author Comment

by:rtarna
ID: 11780202
Sorry, when I said "This code works perfect on my machine" - I ment my client machine. The actual html files are hosted on a server. That's why I'm surprised that the only client that actually works is mine.
So, do I still need to follow your advise on adding the trusted site or is this now a different problem?
0
 
LVL 3

Accepted Solution

by:
topless_stang earned 250 total points
ID: 11786331
I was hoping someone else would have replied with a definitive answer for you.  I have run nto this issue, but am far from a security expert.

I'd suggest comparing your security settings to your clients and go from there.

Are your clients in the same windows domain?  If not, it could be you have a policy to trust network servers within your domain - they would not have that.
0
 

Author Comment

by:rtarna
ID: 11787402
I figured it out. The problem was with the security settings in IE. You have to check the option to run ActiveX controls. Thanks anyway.
0
 

Expert Comment

by:will1383
ID: 12155646
Strange,

I have performed the same exact function here to run an .exe located on a client, but I continously get an error "File Not found" when ever I try to run the client side exe.  Any ideas as to why this is occurring?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Suggested Solutions

Title # Comments Views Activity
"Pause" execution of javascript function for x miliseconds 2 46
edit .asp files 5 32
Media Queries  not Firing 6 19
Extracting content from meta tag PHP MYHTML DOM 3 22
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

821 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