Created
October 9, 2013 05:05
-
-
Save wirepair/6896466 to your computer and use it in GitHub Desktop.
Run a OS command from a firefox plugin or from Error Console
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Either put into a plugin or open error console to test: (Ctrl+Shift+J) -> paste -> click 'Evaluate' | |
Enjoy, | |
@_wirepair | |
linux: | |
var file=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);file.initWithPath("/usr/bin/gcalctool");var process=Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);process.init(file);process.run(false, null, 0); | |
Windows: | |
var file=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile);file.initWithPath("C:\\windows\\system32\\calc.exe");file.launch(); | |
or | |
var file=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);file.initWithPath("C:\\windows\\system32\\calc.exe");file.launch(); | |
or | |
var file=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile);file.initWithPath("C:\\windows\\system32\\calc.exe");var process=Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);process.init(file);process.run(false, null, 0); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment