Skip to content

Instantly share code, notes, and snippets.

@piscisaureus
Created September 5, 2011 23:15
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 piscisaureus/1196144 to your computer and use it in GitHub Desktop.
Save piscisaureus/1196144 to your computer and use it in GitHub Desktop.
var util = require('util'),
spawn = require('child_process').spawn;
function s(img) {
var p = spawn(s);
p.stdout.on('data', function (data) {
console.log(s + ': stdout: ' + data);
});
p.stderr.on('data', function (data) {
console.log(s + ': stderr: ' + data);
});
p.on('exit', function (code) {
console.log(s + ': child process exited with code ' + code);
});
}
s('notepad');
s('calc');
s('regedit');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment