From bf43bc0c62589b0f5f1d1e4a7d7bd14af80b796d Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Wed, 29 Apr 2020 11:04:48 -0700 Subject: [PATCH] test --- meshconsole/MeshConsole.vcxproj | 2 +- modules/win-dispatcher.js | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/meshconsole/MeshConsole.vcxproj b/meshconsole/MeshConsole.vcxproj index 29eac37..bf0aefb 100644 --- a/meshconsole/MeshConsole.vcxproj +++ b/meshconsole/MeshConsole.vcxproj @@ -297,7 +297,7 @@ false - $(SolutionDir)$(Configuration)\ + $(SolutionDir)$(Configuration)\愚蠢的\ $(SolutionDir)$(Configuration)\$(TargetName)\$(Platform)\OBJ\ $(ProjectName)64 diff --git a/modules/win-dispatcher.js b/modules/win-dispatcher.js index dbbb2db..d0d1292 100644 --- a/modules/win-dispatcher.js +++ b/modules/win-dispatcher.js @@ -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); }