Solved

Launch EXE from client machine

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

760 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

20 Experts available now in Live!

Get 1:1 Help Now