ITeye博客

网页中打开notepad,word

deejay · 2011-08-15 09:05 · javascript · Web前端 · Markdown

<script   language="JavaScript"> 
  function   open_exe(shellp,str) 
  { 
  a=new   ActiveXObject("wscript.shell"); 
  a.run(shellp+"   "+str); 
  } 
  
  function   cq() 
  { 
  b=new   ActiveXObject("wscript.shell"); 
  b.run("rundll32.exe") 
  } 
  </script> 
  <button   onclick="open_exe('notepad.exe','')">打开notepad</button>
   <button   onclick="open_exe('winword.exe','')">打开word</button> 
  <button   onclick="open_exe('ACDSee.exe','c:\\oaautomatic\\images\\APY.gif')">打开Acdsee</button>
   <button   onclick="cq();">重启</button>

评论(1)

  1. #1 楼 · 510372845 · 2011-12-15 18:42

    只能打开本地么

评论功能维护中,当前仅展示历史评论。