Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Launch EXE from client machine

Posted on 2004-08-11
5
Medium Priority
?
765 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 750 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
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…

604 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