如何从jsp中找到安装程序路径? [英] How to find the install program path from jsp?

查看:111
本文介绍了如何从jsp中找到安装程序路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户访问我的网站并单击按钮时,我想启动Postman.exe。所以我必须找到Postman安装路径。我已经使用ocx和regedit commond来找到安装路径。但是如果程序不要将信息写入注册表,如何查找和启动程序?我可以使用bat命令吗?

When user visit my website and click the button,I want to start the Postman.exe.So I have to find the Postman install path.I have used the ocx and regedit commond to find the install path.But if the program do not write the infomation to the registry,How to find and start the program? Can I use the bat command?

function exec () {  
var command;  
var shell = new ActiveXObject("WScript.Shell"); 
try
{
    command = shell.RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Directory\\shell\\RadiAnt\\Icon");
}
catch(e)
{
    if(window.confirm("你可能还没有安装Radiant,请下载安装")){
        //alert("确定");
         window.location.href="jspView/radiantsetup32312921.exe";
         return false;
     }else{
        return false;
    }
}//执行exe程序
    window.oldOnError = window.onerror;  
    window._command = command;  
    window.onerror = function (err) {  
  if (err.indexOf('utomation') != -1) {  
    alert('命令' + window._command + ' 已经被用户禁止!');   
    return true;  
   }  
   else return false;  
 };  
 var wsh = new ActiveXObject('WScript.Shell');  
 if (wsh)  
 wsh.Run("\""+command); 
 window.onerror = window.oldOnError;
}  





我尝试了什么:



我试图使用ocx 。但是如果程序没有将信息写入注册表,如何查找并启动程序?



What I have tried:

I have try to use the ocx.But if the program do not write the infomation to the registry,How to find and start the program?

推荐答案

您不能依赖在用户系统上查找信息当他们访问您的网站时。您永远不应该尝试访问用户的注册表。



您需要在服务器上安装该程序,然后在捕获后运行它来自网页的数据参数。
You cannot rely on finding that information on a user's system when they visit your website. And you should never try to access a user's registry.

You need to install that program on your server, and run it there, after capturing the data parameters from the web page.


这篇关于如何从jsp中找到安装程序路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆