Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calc.exe in javascript

Status
Not open for further replies.

Vadim

Programmer
Feb 5, 2002
75
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>
 
I certainly hope not! What's to stop someone from running "format c:" or something else nasty? :)
 
<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
 
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?
 
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
 
aha, i missed out the new keyword...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top