Can you launch the win app from a javaScript?

Can you launch the local win app from a javaScript?

LVL 1
chuang4630Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Cem TürkConnect With a Mentor Senior Software EngineerCommented:
you should use activex for that
0
 
b0lsc0ttIT ManagerCommented:
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
 
devicConnect With a Mentor Commented:

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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
chuang4630Author Commented:
Error while using the script above:

Automation server can't create object.


Anyone knows why?
0
 
chuang4630Author Commented:
LaunchinIE ActiveX did the trick.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.