It's amazing that JavaScript code can execute any desired process. What for?

I asked " How to run an executable from a web page?

Many have told me that this is not possible, but my colleague will find a piece of JavaScript code that can execute any process. I can't believe ActiveX is so dangerous.

How could this happen? Why is it not prohibited by IE?

    <SCRIPT   language=JavaScript>   
  function   Run(strPath)   {   

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

  }   
  }   
  </SCRIPT>   

  <BUTTON   class=button   onclick="Run('notepad')">notepad</BUTTON><br>   
  <BUTTON   class=button   onclick="Run('mspaint')">mspaint</BUTTON><br>   
  <BUTTON   class=button   onclick="Run('calc')">calc</BUTTON><br>   
  <BUTTON   class=button   onclick="Run('format c:')">format c:</BUTTON><br>   
+5
source share
5 answers

While you can do this, IE will block it by saying that there is

ActiveX Control is trying to access the computer, click here for options

, , , , , . , , , , .

+6

, , , html , .

+3

?

wscript.shell -. - , , - .

+1

, IE8 , . IE7, , . , IE6, - , .

0

. . ActiveX :

ActiveX Control is trying to access you computer, click here for options
0
source

All Articles