Suprisingly, JavaScript Code could execute any process it want. Why?
<p>I asked "<a href="http://stackoverflow.com/questions/1205584/how-to-run-a-executable-file-from-a-web-page">How to run a executable file from a web page?</a>"</p>

<p>Many people told me that's impossible, but my colleague find a piece of JavaScript code that could execute any process.  I can not believe ActiveX is so dangerous.</p>

<p>How could this happen?  Why this is not forbidden by IE?</p>

<pre><code>    &lt;SCRIPT   language=JavaScript&gt;   
  function   Run(strPath)   {   

  try   {   
  var   objShell   =   new   ActiveXObject("wscript.shell");   
  objShell.Run(strPath);   
  objShell   =   null;   
  }   
  catch   (e){alert('Can not find "'+strPath)   

  }   
  }   
  &lt;/SCRIPT&gt;   

  &lt;BUTTON   class=button   onclick="Run('notepad')"&gt;notepad&lt;/BUTTON&gt;&lt;br&gt;   
  &lt;BUTTON   class=button   onclick="Run('mspaint')"&gt;mspaint&lt;/BUTTON&gt;&lt;br&gt;   
  &lt;BUTTON   class=button   onclick="Run('calc')"&gt;calc&lt;/BUTTON&gt;&lt;br&gt;   
  &lt;BUTTON   class=button   onclick="Run('format c:')"&gt;format c:&lt;/BUTTON&gt;&lt;br&gt;   
</code></pre>
