IE和Firefox下执行exe程序
来源:互联网 发布:数据挖掘就业前景 编辑:程序博客网 时间:2024/04/20 09:22
IE 下执行exe程序 (ActiveX)
- <a href="javascript:LaunchApp()">Click here to Execute your file</a>
- <script>
- function LaunchApp() {
- if (!document.all) {
- alert ("This ActiveXObject is only available for Internet Explorer");
- return;
- }
- var ws = new ActiveXObject("WScript.Shell");
- ws.Exec("D:\\Software\\youfile.exe");
- }
- </script>
Firefox 下执行exe程序
- <a href="javascript:LaunchApp()">Click here to Execute your file</a>
- <script>
- functionLaunchApp() {
- netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
- var file=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
- file.initWithPath("D:\\Software\\yourfile.exe");
- file.launch();
- }
- </script>
例子:如果exe带参数则var args = ["argument1", "argument2"];
- var file = Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile);
- file.initWithPath("c:\\myapp.exe");
- // create an nsIProcess
- var process = Components.classes["@mozilla.org/process/util;1"]
- .createInstance(Components.interfaces.nsIProcess);
- process.init(file);
- // Run the process.
- // If first param is true, calling thread will be blocked until
- // called process terminates.
- // Second and third params are used to pass command-line arguments
- // to the process.
- var args = ["argument1", "argument2"];
- process.run(false, args, args.length);
积累:
- var WSS = new ActiveXObject("WScript.Shell");
- WSS.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Device","pdfFactory Pro,winspool,FPP2:");
- IE和Firefox下执行exe程序
- IE和Firefox下event
- FireFox和IE 中 Ajax 同步执行
- Css处理IE和FIREFOX下兼容问题。。。
- IE和FIREFOX下CSS的区别
- IE和Firefox下event乱谈
- IE和FIREFOX下CSS的区别
- IE和Firefox下event乱谈
- IE和Firefox下javascript的不同
- IE和Firefox下event乱谈
- IE和Firefox下的Cookie兼容问题
- getElementById在IE和FireFox下兼容问题
- IE和Firefox下event乱谈
- Firefox和IE下使用ajax
- js在IE和Firefox下不同之处
- IE和firefox下event区别
- IE和Firefox下event事件杂谈
- js在IE和Firefox下不同之处
- 数据库之外键学习
- 怎么简单怎么来
- 用table画出日历。
- 手机游戏发展趋势分析和预测
- new iPad/iPad2/ipad 三代平板参数对比
- IE和Firefox下执行exe程序
- SQL多表删除
- hdu 3415
- Android文件存储
- BCB 处理机器时间设置(h or HH)不同的bug
- COMMCONFIG进行配置的WIN32 API .
- Android中如何实现图像的闪动
- Android学习笔记:ListView上拉加载,下拉刷新的实现
- eclipse反编译jad.exe工具