From 663d63bde08dd1b0d43ec144c758399cec90ec70 Mon Sep 17 00:00:00 2001 From: undergroundwires Date: Sun, 10 Jan 2021 01:35:30 +0100 Subject: [PATCH] recommend onedrive removal on strict mode --- src/application/collections/windows.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/application/collections/windows.yaml b/src/application/collections/windows.yaml index 35f0dccc..efa2be69 100644 --- a/src/application/collections/windows.yaml +++ b/src/application/collections/windows.yaml @@ -3497,10 +3497,12 @@ actions: children: - name: Kill OneDrive process + recommend: strict code: taskkill /f /im OneDrive.exe revertCode: '"%LOCALAPPDATA%\Microsoft\OneDrive\OneDrive.exe"' - name: Uninstall OneDrive + recommend: strict code: |- if %PROCESSOR_ARCHITECTURE%==x86 ( %SystemRoot%\System32\OneDriveSetup.exe /uninstall 2>null @@ -3515,6 +3517,7 @@ actions: ) - name: Remove OneDrive leftovers + recommend: strict code: |- rd "%UserProfile%\OneDrive" /q /s rd "%LocalAppData%\Microsoft\OneDrive" /q /s @@ -3522,6 +3525,7 @@ actions: rd "%SystemDrive%\OneDriveTemp" /q /s - name: Delete OneDrive shortcuts + recommend: strict docs: https://docs.microsoft.com/en-us/sharepoint/troubleshoot/installation-and-setup/how-to-block-onedrive.exe-from-being-advertised-after-install-office-2016 code: |- del "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Microsoft OneDrive.lnk" /s /f /q @@ -3529,6 +3533,7 @@ actions: del "%USERPROFILE%\Links\OneDrive.lnk" /s /f /q - name: Disable usage of OneDrive + recommend: strict code: |- reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\OneDrive" /t REG_DWORD /v "DisableFileSyncNGSC" /d 1 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\OneDrive" /t REG_DWORD /v "DisableFileSync" /d 1 /f @@ -3537,6 +3542,7 @@ actions: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\OneDrive" /t REG_DWORD /v "DisableFileSync" /d 0 /f - name: Prevent automatic OneDrive install for current user + recommend: strict code: reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "OneDriveSetup" /f revertCode: |- if %PROCESSOR_ARCHITECTURE%==x86 ( @@ -3546,6 +3552,7 @@ actions: ) - name: Prevent automatic OneDrive install for new users + recommend: strict code: |- reg load "HKU\Default" "%SystemDrive%\Users\Default\NTUSER.DAT" reg delete "HKU\Default\software\Microsoft\Windows\CurrentVersion\Run" /v "OneDriveSetup" /f @@ -3560,6 +3567,7 @@ actions: reg unload "HKU\Default" - name: Remove OneDrive from explorer menu + recommend: strict code: |- reg delete "HKCR\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f reg delete "HKCR\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f @@ -3570,9 +3578,11 @@ actions: reg add "HKCR\Wow6432Node\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v System.IsPinnedToNameSpaceTree /d "1" /t REG_DWORD /f - name: Delete all OneDrive related Services + recommend: strict code: for /f "tokens=1 delims=," %%x in ('schtasks /query /fo csv ^| find "OneDrive"') do schtasks /Delete /TN %%x /F - name: Delete OneDrive path from registry + recommend: strict docs: https://stackoverflow.com/questions/46744840/export-registry-value-to-file-and-then-set-a-variable-in-batch code: reg delete "HKCU\Environment" /v "OneDrive" /f -