Solved

Launch EXE from client machine

Posted on 2004-08-11
5
759 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

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

Title # Comments Views Activity
Making my existing website "mobile friendly"... 10 35
Asp.net mvc foreach 3 35
Split in Javascript 5 31
Change text to radio button and calendar form 2 32
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

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

18 Experts available now in Live!

Get 1:1 Help Now