JavaScript打开客户端exe文件

  1. <scripttype="text/javascript">
  2. <!--
  3. functionrunExecutable()
  4. {
  5. varexecutableFullPath='F://ZK//DownLoadFile//YodaoDict.exe';
  6. try
  7. {
  8. varshellActiveXObject=newActiveXObject("WScript.Shell");
  9. if(!shellActiveXObject)
  10. {
  11. alert('CouldnotgetreferencetoWScript.Shell');
  12. return;
  13. }
  14. shellActiveXObject.Run(executableFullPath,1,false);
  15. shellActiveXObject=null;
  16. }
  17. catch(errorObject)
  18. {
  19. alert('Error:/n'+errorObject.message);
  20. }
  21. }
  22. //-->
  23. </script>
  24. <inputtype="button"onclick="runExecutable()"value="打开客户端程序">

你可能感兴趣的:(JavaScript)