launch an application from browser with parameters

2019-08-30 19:24发布

问题:

I am trying to launch an application from a webpage with parameters. Activex shown below works only at IE.

MyObject = new ActiveXObject( "WScript.Shell" );  
MyObject.Run('"C:\\Program Files\\application.exe" -guiparm=".." -system=..-client=..-user=.. -pw=..');  `

Is there any other way to do that cross browser?

Thank you very much for your help

回答1:

You can use the following:

<a href="c:\windows\Notepad.exe" 
type="application/octet-stream">Launch Notepad</a>

From what I remember using file:// is blocked by Chrome and Firefox. I don't know how to send parameters but at least you can launch an application without using an ActiveXObject.