0

I am trying to run the below code which launches notepad. IE tab is nice solution, but loading is slow. I gave the try to ff-activex-host.I downloaded the binary exe. I copied the npffax.dll to firefox plugin folder(C:\Program Files\Mozilla Firefox\plugins) . But, still the above code is not working. I am getting the message "ActiveXObject is not defined" in web console. Can anybody shed a light on this issue?. Please clear me of running this code. This is the code I am trying.

var commandtoRun ="C:\\WINDOWS\\notepad.exe";
var oShell = new ActiveXObject("WScript.Shell");
oShell.run(commandtoRun);

EDIT: Any suggestion to run the above code in firefox is welcomed.

c69
  • 19,951
  • 7
  • 52
  • 82
prabhakaran
  • 5,126
  • 17
  • 71
  • 107

1 Answers1

1

Here is sample code from MDN:

var file = Components.classes["@mozilla.org/file/local;1"]  
                 .createInstance(Components.interfaces.nsILocalFile);  
file.initWithPath("c:\\myapp.exe");  
file.launch();  

Keep in mind, this is not cross-browser and will not work on Linux. If this is critical for you, - use nsIProcess interface, https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIProcess

c69
  • 19,951
  • 7
  • 52
  • 82