Improved stop/disable service command

This commit is contained in:
Serge
2023-07-19 11:38:06 +02:00
parent 2b8d82b58f
commit 3598f5dec8
2 changed files with 3 additions and 3 deletions

View File

@@ -9,6 +9,8 @@ namespace GHelper.Helpers
{
static List<string> services = new() {
"ArmouryCrateControlInterface",
"ASUSOptimization",
"AsusAppService",
"ASUSLinkNear",
"ASUSLinkRemote",
@@ -16,8 +18,6 @@ namespace GHelper.Helpers
"ASUSSwitch",
"ASUSSystemAnalysis",
"ASUSSystemDiagnosis",
"ASUSOptimization",
"ArmouryCrateControlInterface",
"AsusCertService"
};

View File

@@ -103,7 +103,7 @@ namespace GHelper.Helpers
{
try
{
string script = $"Set-Service -Name \"{serviceName}\" -Status stopped -StartupType disabled";
string script = $"Get-Service -Name \"{serviceName}\" | Stop-Service -Force -PassThru | Set-Service -StartupType Disabled";
Logger.WriteLine(script);
RunCMD("powershell", script);
}