Hi to all those trying to call exe using javascript in mozilla firefox. Follow the instructions. I can run exe from my site.
Step 1. Enter "about: config" in the address bar and make "signed.applets.codebase-main-support" true. Step 2. Use this code.
<html> <head> </head> <body> <p/><input type="button" width="15" value="Run Exe" onclick="RunExe();"/></input></p> <script type="text/javascript"> function RunExe() { alert("In fun RunExe().."); netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); alert("Done"); var exe = window.Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile); exe.initWithPath("c:\\WINDOWS\\notepad.exe"); alert("exe"); var run = window.Components.classes['@mozilla.org/process/util;1'].createInstance(Components.interfaces.nsIProcess); run.init(exe); var parameters = [""]; run.run(false, parameters,parameters.length); alert("in function RunBat"); } </script> </body> </html>
source share