delete Onedrive task fixed

This commit is contained in:
Michael H.G. Schmidt 2021-05-26 23:26:16 +02:00
parent a07ac3307b
commit 352c11f688
2 changed files with 1 additions and 10 deletions

View File

@ -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}

View File

@ -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 #######