Click here to Skip to main content
15,886,052 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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;
}  


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?
Posted
Updated 9-May-18 1:45am

1 solution

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.
 
Share this answer
 
Comments
PEIYANGXINQU 9-May-18 8:46am    
The tool seems like winform or java desktop application, and the database is encrypted and not open.It is very difficult to capture the data.
Richard MacCutchan 9-May-18 9:28am    
I am not sure what that means, but you are doing this completely the wrong way round. Websites are supposed to provide information to users, not to rely on the user's PC to do it for them.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900