New
#11
OneDrive tasks can be deleted by:
Get-ScheduledTask "OneDrive*" | Unregister-ScheduledTask -Confirm:$false
Have I said that the tasks were not deleted automatically when I uninstalled OneDrive?
I have only one left, which I disable, also its services and startup entries.
Code:rem Remove OneDrive taskkill /F /IM onedrive.exe "%SYSTEMROOT%\System32\OneDriveSetup.exe" /uninstall "%SYSTEMROOT%\SysWOW64\OneDriveSetup.exe" /uninstall rd "%LOCALAPPDATA%\Microsoft\OneDrive" /Q /S rd "%PROGRAMDATA%\Microsoft OneDrive" /Q /S rd "%USERPROFILE%\OneDrive" /Q /S rem 0 - Remove from Windows Explorer reg add "HKCR\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d "0" /f reg add "HKCR\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d "0" /f reg add "HKCU\Software\Classes\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d "0" /f reg add "HKCU\Software\Classes\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d "0" /f rem Hide One Drive Icon on Desktop reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /t REG_DWORD /d "1" /f rem Disable network traffic pre user sign-in reg add "HKLM\Software\Policies\Microsoft\OneDrive" /v "PreventNetworkTrafficPreUserSignIn" /t REG_DWORD /d "1" /f rem 1 - Disable sync files to One Drive reg add "HKCU\Software\Microsoft\OneDrive" /v "DisablePersonalSync" /t REG_DWORD /d "1" /f reg add "HKLM\Software\Policies\Microsoft\Windows\OneDrive" /v "DisableFileSync" /t REG_DWORD /d "1" /f reg add "HKLM\Software\Policies\Microsoft\Windows\OneDrive" /v "DisableFileSyncNGSC" /t REG_DWORD /d "1" /f reg add "HKLM\Software\Wow6432Node\Policies\Microsoft\Windows\Onedrive" /v "DisableFileSyncNGSC" /t REG_DWORD /d "1" /f rem 1 - Disable saving Libraries to OneDrive reg add "HKLM\Software\Policies\Microsoft\Windows\OneDrive" /v "DisableLibrariesDefaultSaveToOneDrive" /t REG_DWORD /d "0" /f reg add "HKLM\Software\Wow6432Node\Policies\Microsoft\Windows\Onedrive" /v "DisableLibrariesDefaultSaveToOneDrive" /t REG_DWORD /d "1" /f rem 1 - Disable Sync over metered network reg add "HKLM\Software\Policies\Microsoft\Windows\OneDrive" /v "DisableMeteredNetworkFileSync" /t REG_DWORD /d "1" /f reg add "HKLM\Software\Wow6432Node\Policies\Microsoft\Windows\Onedrive" /v "DisableMeteredNetworkFileSync" /t REG_DWORD /d "1" /f rem Remove Startup entry reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "OneDrive" /f rem Disable Service sc config OneSyncSvc start= disabled sc config OneSyncSvc_Session1 start= disabled rem Disable Task schtasks /Change /TN "OneDrive Standalone Update Task v2" /Disable