Solved

Can you launch the win app from a javaScript?

Posted on 2006-11-27
6
522 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_turk earned 400 total points
ID: 18021972
you should use activex for that
0
 
LVL 25

Assisted Solution

by:devic
devic earned 100 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
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.

 
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

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

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
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-…
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…

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

21 Experts available now in Live!

Get 1:1 Help Now