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?
 
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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
All Courses

From novice to tech pro — start learning today.