Created
January 23, 2014 08:45
-
-
Save pwlin/8575119 to your computer and use it in GitHub Desktop.
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
var path = require('path'); | |
var consolePath = path.join(path.dirname(process.execPath), 'NWHelper.exe'); | |
console.log(consolePath); | |
var spawn = require('child_process').spawn; | |
var prc = spawn(consolePath, ['UserInfo.getLoggedInUserName']); | |
//noinspection JSUnresolvedFunction | |
prc.stdout.setEncoding('utf8'); | |
prc.stdout.on('data', function (data) { | |
var str = data.toString() | |
//var lines = str.split(/(\r?\n)/g); | |
//console.log(lines.join("")); | |
console.log(str); | |
}); | |
prc.on('close', function (code) { | |
console.log('process exit code ' + code); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment