Solved

Launch EXE from client machine

Posted on 2004-08-11
5
762 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
[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
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
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…

742 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