From 94a5f09aa4faedce3218ebac14a6c4fcd6804ee9 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 28 Jun 2023 22:07:18 +0200 Subject: [PATCH] Disable scheduled task registration --- scripts/Windows/OS/User.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/Windows/OS/User.ps1 b/scripts/Windows/OS/User.ps1 index c0554eae..8fb7fae2 100644 --- a/scripts/Windows/OS/User.ps1 +++ b/scripts/Windows/OS/User.ps1 @@ -52,8 +52,7 @@ function Enable-UACNextLogin() { " ", @( "-c", - "Set-ItemProperty `"$keyPath`" -Name `"$propertyName`" -Value 0;", - "Unregister-ScheduledTask -Force $taskName;"))); + "Set-ItemProperty `"$keyPath`" -Name `"$propertyName`" -Value 0;"))); $trigger = New-ScheduledTaskTrigger -AtLogOn; $principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest;