1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-06 02:23:59 +00:00

replace wmi service with net

This commit is contained in:
si458
2024-11-03 15:14:05 +00:00
parent 3890ea2b7b
commit d08c5ceb71
3 changed files with 9 additions and 8 deletions

View File

@@ -923,8 +923,8 @@ function serviceManager()
if (this.isMe())
{
// In order to restart ourselves on Windows, we must spawn a detached child process, becuase we need to call start, once we are stopped
require('child_process')._execve(process.env['windir'] + '\\system32\\cmd.exe', ['cmd.exe', '/C wmic service "' + this.name + '" call stopservice & wmic service "' + this.name + '" call startservice']);
}
require('child_process')._execve(process.env['windir'] + '\\system32\\cmd.exe', ['cmd.exe', '/C net stop "' + this.name + '" & net stop "' + this.name + '"']);
}
else
{
var p = this.stop();