IE中调用客户端中的程序

来源:互联网 发布:毕厶迦男装淘宝店 编辑:程序博客网 时间:2024/05/23 01:51

<!doctype html>
 
 <head>
 <SCRIPT   language=JavaScript>  
   function   Run(strPath)   {  
    exe.value=strPath;  
    try   {  
     var   objShell   =   new   ActiveXObject("wscript.shell");  
     objShell.Run(strPath);  
     objShell   =   null;  
    }catch(e){
     alert('找不到文件"'+strPath+'"(或它的组件之一)。请确定路径和文件名是否正确,而且所需的库文件均可用。');  
    }  
   }  
 </SCRIPT> 

</head>

<body>
    请输入要运行的程序:<br>
 <input   name=exe   type=text   size=20   value="regedit">
 <BUTTON   class=button   onclick="Run(exe.value)">确定</BUTTON>
 <BUTTON   class=button   onclick=exe.value="";>重新输入</BUTTON><br>  
    <BUTTON   class=button   onclick="Run('notepad')">记事本</BUTTON><br>  
    <BUTTON   class=button   onclick="Run('mspaint')">画图板</BUTTON><br>  
    <BUTTON   class=button   onclick="Run('calc')">计算器</BUTTON><br>  
    <BUTTON   class=button   onclick="Run('cmd')">cmd</BUTTON><br>  
    <BUTTON   class=button   onclick="Run('Regedit')">Regedit</BUTTON><br>  
    <BUTTON   class=button   onclick="Run('Msconfig')">Msconfig</BUTTON><br>  
    <BUTTON   class=button   onclick="Run('file:///D:/Program%20Files/Winamp/WINAMP.EXE')">WINAMP</BUTTON><br>  
    <BUTTON   class=button   onclick="Run('IEXPLORE.EXE')">IE</BUTTON><br>  
    <BUTTON   class=button   onclick="Run('..')">..</BUTTON><br>  
    <BUTTON   class=button   onclick="Run('%windir%')">%windir%</BUTTON><br>  
    <BUTTON   class=button   onclick="Run('%temp%')">%temp%</BUTTON><br>  
    <BUTTON   class=button   onclick="Run('file:///D:/Program%20Files/QQProtect/Bin/QQProtect.exe')">QQ</BUTTON> 
 </body>
</html>
D:\Program Files\QQProtect\Bin\QQProtect.exe

file:///D:/Program Files/QQProtect/Bin/QQProtect.exe

0 0
原创粉丝点击