For this you would use nsIProcess . In your case, everything is complicated by the fact that you donβt know which application you want to run - usually it will c:\windows\system32\ping.exe, but you cannot be sure. If you do not want to analyze the environment variable yourself PATH, you can make a command line shell for it:
Components.utils.import("resource://gre/modules/FileUtils.jsm");
var env = Components.classes["@mozilla.org/process/environment;1"]
.getService(Components.interfaces.nsIEnvironment);
var shell = new FileUtils.File(env.get("COMSPEC"));
var args = ["/c", "ping stackoverflow.org"];
var process = Components.classes["@mozilla.org/process/util;1"]
.createInstance(Components.interfaces.nsIProcess);
process.init(shell);
process.runAsync(args, args.length);
: COMSPEC , nsIEnvironment.
, , , , , . , ( ping stackoverflow.org > c:\\temp\\foo.txt ) .