mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Improved stop/disable service command
This commit is contained in:
@@ -9,6 +9,8 @@ namespace GHelper.Helpers
|
|||||||
{
|
{
|
||||||
|
|
||||||
static List<string> services = new() {
|
static List<string> services = new() {
|
||||||
|
"ArmouryCrateControlInterface",
|
||||||
|
"ASUSOptimization",
|
||||||
"AsusAppService",
|
"AsusAppService",
|
||||||
"ASUSLinkNear",
|
"ASUSLinkNear",
|
||||||
"ASUSLinkRemote",
|
"ASUSLinkRemote",
|
||||||
@@ -16,8 +18,6 @@ namespace GHelper.Helpers
|
|||||||
"ASUSSwitch",
|
"ASUSSwitch",
|
||||||
"ASUSSystemAnalysis",
|
"ASUSSystemAnalysis",
|
||||||
"ASUSSystemDiagnosis",
|
"ASUSSystemDiagnosis",
|
||||||
"ASUSOptimization",
|
|
||||||
"ArmouryCrateControlInterface",
|
|
||||||
"AsusCertService"
|
"AsusCertService"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ namespace GHelper.Helpers
|
|||||||
{
|
{
|
||||||
try
|
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);
|
Logger.WriteLine(script);
|
||||||
RunCMD("powershell", script);
|
RunCMD("powershell", script);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user