Skip to content

Instantly share code, notes, and snippets.

@robcee
Created October 20, 2012 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robcee/3923277 to your computer and use it in GitHub Desktop.
Save robcee/3923277 to your computer and use it in GitHub Desktop.
/*
* This is a JavaScript Scratchpad.
*
* Enter some JavaScript, then Right Click or choose from the Execute Menu:
* 1. Run to evaluate the selected text (Ctrl+R),
* 2. Inspect to bring up an Object Inspector on the result (Ctrl+I), or,
* 3. Display to insert the result in a comment after the selection. (Ctrl+L)
*/
Components.utils.import("resource://gre/modules/osfile.jsm");
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
file.initWithPath("c:\\Windows\\explorer.exe");
var process = Components.classes["@mozilla.org/process/util;1"]
.createInstance(Components.interfaces.nsIProcess);
process.init(file);
let args = [OS.Constants.Path.profileDir];
process.run(false, args, args.length);
@grssam
Copy link

grssam commented Oct 20, 2012

wouldn't file.reveal() do the job too ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment