|
- <script>
- function LaunchApp(path,argu) {
- //For FireFox
- if (!document.all) {
- netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
- var exe = window.Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
- exe.initWithPath(path);
- var run = window.Components.classes['@mozilla.org/process/util;1'].createInstance(Components.interfaces.nsIProcess);
- run.init(exe);
- var parameters = [argu];
- run.run(false, parameters, parameters.length);
- return;
- }
-
- //For IE
- var ws = new ActiveXObject("WScript.Shell");
- ws.run(path + " " + argu);
- }
- </script>
复制代码
应用
- <a href="javascript:LaunchApp('C:\\MyFolder\\MyProgram.exe','MyArgument')">Run My Program</a>
复制代码 |
|