Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Can you launch the win app from a javaScript?

Posted on 2006-11-27
6
Medium Priority
?
532 Views
Last Modified: 2007-12-19
Can you launch the local win app from a javaScript?

0
Comment
Question by:chuang4630
6 Comments
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 18021448
chuang4630,

What do you mean "the" local win app?  What specific app are you referring to?  In general Javascript can't be used to "run" programs on the computer because of browser limitations and security.  The browser doesn't have that type of access to the computer's files.  However if this app has a plugin or some similar connection to the browser then that can be used to start the application (i.e. Windows media player).  This isn't specifically done with javascript but with an object tag or using similar html.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
LVL 17

Accepted Solution

by:
Cem Türk earned 1600 total points
ID: 18021972
you should use activex for that
0
 
LVL 25

Assisted Solution

by:devic
devic earned 400 total points
ID: 18023709

JS example:
//====================================================
<script>
   var ws = new ActiveXObject("WScript.Shell");
   ws.Exec("c:\\Windows\\Notepad.exe")
</script>


VBS example:
//====================================================
<script language="VBScript">
    Set shell = CreateObject("WScript.Shell")
      shell.Run("c:\WINDOWS\Notepad.exe ")
</script>
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Author Comment

by:chuang4630
ID: 18029020
Error while using the script above:

Automation server can't create object.


Anyone knows why?
0
 
LVL 25

Expert Comment

by:devic
ID: 18029140
0
 
LVL 1

Author Comment

by:chuang4630
ID: 18070201
LaunchinIE ActiveX did the trick.
0

Featured Post

Technology Partners: 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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…
Suggested Courses

916 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