Launching an executable from a website?

前端 未结 11 757
小鲜肉
小鲜肉 2020-12-29 16:45

We\'re developing a site that will only run on the intranet, and computers with access to this intranet will have this executable installed. We can\'t have any \"Would you

11条回答
  •  执念已碎
    2020-12-29 17:12

    Try this JavaScript:

    function executeCommands(inputparms)
    {
    // Instantiate the Shell object and invoke its execute method.
    
    var oShell = new ActiveXObject("Shell.Application");
    
    var commandtoRun = "c:\windows\Notepad.exe";
    
    // Invoke the execute method. 
    oShell.ShellExecute(commandtoRun, commandParms, "", "open", "1"); 
    }
    

    You will have to set the browser security settings accordingly, and this would work only in IE.

提交回复
热议问题