Closed abedzaben28 closed 6 years ago
I can't reproduce this issue. I wrote a test script:
const WinExe = require('winexe');
const winexe = new WinExe({
username: 'admin@domain',
password: 'password',
host: 'ip.of.remote.host'
});
winexe.run('ipconfig /all', function (err, result) {
console.log(`ipconfig /all: ${err || result.split('\n').length} lines`);
});
winexe.run('cmd.exe /c ipconfig /all', function (err, result) {
console.log(`cmd.exe /c ipconfig /all: ${err || result.split('\n').length} lines`);
});
And got next result:
ipconfig /all: 65 lines
cmd.exe /c ipconfig /all: 65 lines
My host is a Windows 2008 R2. The remote host is a Windows 2012 R2.
You can try my script. And you can try to use paexec directly. Download the paexec from https://www.poweradmin.com/paexec/. By the way you can try to use psexec and compare results.
if commanding "ipcofig/all" directly using paexec in remote machine returns: (empty line) (empty line) Windows IP Configuration (empty line) Host Name . . . . . . . . . . . . : mymachinename Primary Dns Suffix . . . . . . . : test.com Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No
but from winexe.run('cmd.exe /c ipconfig /all', function (err, stdout, stderr) --> the result missed the first four lines: Host Name . . . . . . . . . . . . : mymachinename Primary Dns Suffix . . . . . . . : test.com Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No
different than the first result it missed the first four lines.