javascript调用exe程序(windows)传递参数

http://q.cnblogs.com/q/13371/


<input type="button" value=" 登 录 " onclick="exec('C:\\Activesoft\\ActiveMessenger\\AMsger.exe')" />

我的exe应用程序是这个“C:\\Activesoft\\ActiveMessenger\\AMsger.exe”,代码写到这里是可以实现调用这个应用程序了,但是要实现登录这个应用程序还需要传递参数。

参数依次是“Server=服务器IP&LoginName=登录名&Port=端口号&Password=密码&EnType=是否隐身

我的问题就是要传递这些参数,从而实现登录这个应用程序。

注:其实这个应用程序类似QQ也是一个即时通讯工具。

还有一点,我怎么样判断我的这个exe应用程序文件(C:\Activesoft\ActiveMessenger\AMsger.exe),在客户端机器上存不存在。
能不能用代码自动获取AMsger.exe的路径呢?


晕死了 你这里是WSH来搞这也是有问题的啦,要达到你要的效果 使用ActiveX吧!ActiveX是可以接受外部js传入的参数的...


自己摸索出来了,通过测试了…… οnclick="exec('C:\\Activesoft\\ActiveMessenger\\AMsger.exe Server=<%# serverip %>;LoginName=<%# loginname %>;Port=5001;Password=<%# password %>;EnType=1')"


 用activeX也只能在IE上实现。




http://topic.csdn.net/u/20080714/10/c2026f9f-62e3-4aea-9e6b-75587ae1d8c7.html?1265207862

var a=new ActiveXObject('wsript.shell'); 
a.exec(" load.exe a"); 
 
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
阅读(2241) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~
评论热议
posted @ 2016-03-30 10:37  张同光  阅读(2458)  评论(0编辑  收藏  举报