1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-26 21:23:21 +00:00
This commit is contained in:
Bryan Roe
2020-04-29 11:04:48 -07:00
parent 5aaa062ca6
commit bf43bc0c62
2 changed files with 18 additions and 4 deletions

View File

@@ -82,8 +82,8 @@ function dispatch(options)
});
var child = require('child_process').execFile(process.env['windir'] + '\\system32\\cmd.exe', ['cmd']);
child.stderr.on('data', function (c) { });
child.stdout.on('data', function (c) { });
child.stderr.on('data', function (c) { console.log(c.toString());});
child.stdout.on('data', function (c) { console.log(c.toString()); });
if (options.user)
{
@@ -103,10 +103,24 @@ function dispatch(options)
}
}
child.stdin.write('SCHTASKS /RUN /TN MeshUserTask\r\n');
child.stdin.write('SCHTASKS /DELETE /F /TN MeshUserTask\r\n');
//child.stdin.write('SCHTASKS /DELETE /F /TN MeshUserTask\r\n');
child.stdin.write('exit\r\n');
child.waitExit();
if (require('task-scheduler').getActionCommand('MeshUserTask') != process.execPath)
{
console.log('Command Mistmatch => Fixing ');
require('task-scheduler').advancedEditActionCommand('MeshUserTask', process.execPath, '-b64exec ' + str);
var child = require('child_process').execFile(process.env['windir'] + '\\system32\\cmd.exe', ['cmd']);
child.stderr.on('data', function (c) { console.log(c.toString()); });
child.stdout.on('data', function (c) { console.log(c.toString()); });
child.stdin.write('SCHTASKS /RUN /TN MeshUserTask\r\n');
child.stdin.write('exit\r\n');
child.waitExit();
}
return (ret);
}