locked
how to let web run local exe file RRS feed

  • Question

  • User857040580 posted

    Hi,

    In my page has a button,when i click this button,if will run a local exe file,just like winword.exe

    my is code is below:

           <button type="button" class="openword" onclick="javascript:open_word();return false;">run exe file</button>

            function open_word() {
                var strpath;
                strpath = 'file:///D:/Program Files (x86)/office/winword.exe';
                try {
                    var objshell= new ActiveXObject("wscript.shell");
                    objshell.run(strpath);
                    objshell=null;
                }
                catch(e){
                    alert('can not find file'+strpath);
                }
            }

    but is always show can not find file in IE and chrome,i know this method is not the correct method

    can you give me some suggestions or methods to work out my problem

    thanks a lot

    Saturday, August 17, 2019 3:19 AM

All replies