From 352c11f68872669b079b9f88e441c24d3778a48d Mon Sep 17 00:00:00 2001 From: "Michael H.G. Schmidt" Date: Wed, 26 May 2021 23:26:16 +0200 Subject: [PATCH] delete Onedrive task fixed --- scripts/A.ps1 | 9 --------- scripts/uninstall-onedrive.cmd | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 scripts/A.ps1 diff --git a/scripts/A.ps1 b/scripts/A.ps1 deleted file mode 100644 index 4c541b2..0000000 --- a/scripts/A.ps1 +++ /dev/null @@ -1,9 +0,0 @@ - -$taskName = “The task name”; -$task = Get-ScheduledTask | Where-Object { $_.TaskName -eq $taskName } | Select-Object -First 1 -if ($null -ne $task) { - $task | Unregister-ScheduledTask -Confirm:$false - Write-Host “Task $taskName was removed” -ForegroundColor Yellow -} - -if (Get-ScheduledTask -TaskName $TaskName){Unregister-ScheduledTask -TaskName $TaskName -Confirm $false} diff --git a/scripts/uninstall-onedrive.cmd b/scripts/uninstall-onedrive.cmd index c2674b9..0e2dd3d 100644 --- a/scripts/uninstall-onedrive.cmd +++ b/scripts/uninstall-onedrive.cmd @@ -34,7 +34,7 @@ reg DELETE "HKEY_CURRENT_USER\Software\Classes\CLSID\{018D5C66-4533-4307-9B53-22 reg DELETE "HKEY_CURRENT_USER\Software\Classes\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\ShellFolder" /f > NUL 2>&1 echo remove OneDrive update task ... -powershell -Command "Unregister-ScheduledTask -Confirm:$false | Where-Object {$_.Taskname -match 'OneDrive Standalone Update'}" +powershell -Command "Get-ScheduledTask | Where-Object {$_.Taskname -match 'OneDrive Standalone Update'} | Unregister-ScheduledTask -Confirm:$false" echo ####### %0 #######