Sep 17, 2004 #1 Vadim Programmer Joined Feb 5, 2002 Messages 75 Location US Is it possible to launch calc.exe in javascript? Same as: <script language="vbscript"> Sub launchCalc() Set WshShell = CreateObject("WScript.Shell") WshShell.Run "calc.exe" End Sub </script>
Is it possible to launch calc.exe in javascript? Same as: <script language="vbscript"> Sub launchCalc() Set WshShell = CreateObject("WScript.Shell") WshShell.Run "calc.exe" End Sub </script>
Sep 17, 2004 #2 cpjust Programmer Joined Sep 23, 2003 Messages 2,132 Location US I certainly hope not! What's to stop someone from running "format c:" or something else nasty? Upvote 0 Downvote
Sep 18, 2004 #3 vbkris Programmer Joined Jan 20, 2003 Messages 5,994 Location IN <script> function launchCalc() { WshShell = ActiveXObject("WScript.Shell") WshShell.Run("calc.exe") } </script> but like vpjust said it is ver dangeous, the above script may not even be allowed in some browsers, others will ask for a confirmation... Known is handfull, Unknown is worldfull Upvote 0 Downvote
<script> function launchCalc() { WshShell = ActiveXObject("WScript.Shell") WshShell.Run("calc.exe") } </script> but like vpjust said it is ver dangeous, the above script may not even be allowed in some browsers, others will ask for a confirmation... Known is handfull, Unknown is worldfull
Sep 18, 2004 #4 cpjust Programmer Joined Sep 23, 2003 Messages 2,132 Location US I couldn't get that code to work on IE 6.0, Netscape 4.71 or 6.1. Are you able to make it work? Upvote 0 Downvote
Sep 18, 2004 #5 tsuji Technical User Joined Jul 25, 2001 Messages 10,675 Location US Hello cpjust, Just for demo. Code: <html> <head> <script language="jscript"> function launchCalc() { var WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run("calc.exe"); } </script> </head> <body onload="launchCalc()"> </body> </html> regards - tsuji Upvote 0 Downvote
Hello cpjust, Just for demo. Code: <html> <head> <script language="jscript"> function launchCalc() { var WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run("calc.exe"); } </script> </head> <body onload="launchCalc()"> </body> </html> regards - tsuji
Sep 20, 2004 #6 vbkris Programmer Joined Jan 20, 2003 Messages 5,994 Location IN aha, i missed out the new keyword... Known is handfull, Unknown is worldfull Upvote 0 Downvote