From 10af199a3b4035aefe9431fe0725e7c9863724f5 Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Tue, 4 Aug 2015 13:51:10 +0200 Subject: [PATCH] merge disable-onedrive.reg into remove-onedrive.ps1 --- scripts/disable-onedrive.reg | Bin 312 -> 0 bytes scripts/remove-onedrive.ps1 | 16 ++++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) delete mode 100644 scripts/disable-onedrive.reg diff --git a/scripts/disable-onedrive.reg b/scripts/disable-onedrive.reg deleted file mode 100644 index 1fff12af39e8f43f197a1f2ebc19762acf2b777d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 312 zcmYk1UrPc}5XFDbLEl0A0FsqH2tCBwKQs#!mvBY2wzv?xuq%mQ-umtJB`(9voHO^# zncrhdpx}d&JvA++7rt}OVk~)N7i4BAFEY#*A{7R+ptwL*FlJR=B0(26CQMy(B{VNd(|uRAYRy9d3s&`021Ie AkN^Mx diff --git a/scripts/remove-onedrive.ps1 b/scripts/remove-onedrive.ps1 index b6385d4..2ebd8a5 100644 --- a/scripts/remove-onedrive.ps1 +++ b/scripts/remove-onedrive.ps1 @@ -1,5 +1,5 @@ # Description: -# This script removes OneDrive files from your system. +# This script will remove and disable OneDrive integration. echo "Kill OneDrive process" kill "OneDrive.exe" @@ -16,4 +16,16 @@ echo "Removing OneDrive leftovers" rm -r -Force "$env:localappdata\Microsoft\OneDrive" rm -r -Force "$env:programdata\Microsoft OneDrive" rm -r -Force "$env:userprofile\OneDrive" -rm -r -Force "C:\OneDriveTemp" \ No newline at end of file +rm -r -Force "C:\OneDriveTemp" + +echo "Disable OneDrive via Group Policies" +$reg = @" +Windows Registry Editor Version 5.00 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive] +"DisableFileSyncNGSC"=dword:00000001 +"@ +$regfile = "$env:windir\Temp\registry.reg" +$reg | Out-File $regfile +regedit /s $regfile +rm $regfile \ No newline at end of file