Skip to content

Instantly share code, notes, and snippets.

@s4y
Created September 14, 2011 02:12
Show Gist options
  • Save s4y/1215700 to your computer and use it in GitHub Desktop.
Save s4y/1215700 to your computer and use it in GitHub Desktop.
child_process.execFile example
var child_process = require('child_process');
// exec: spawns a shell.
child_process.exec('ls -lah /tmp', function(error, stdout, stderr){
console.log(stdout);
});
// execFile: executes a file with the specified arguments
child_process.execFile('ls', ['-lah', '/tmp'], function(error, stdout, stderr){
console.log(stdout);
});
@alighamdan
Copy link

how can i open explorer with specific dir with execFile method?

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