Disable OneDrive in Windows 10

This script will disable OneDrive. Microsoft has integrated OneDrive as one of the built-in features of Windows 10. You cannot “delete” this feature anymore, but you can disable it to prevent the application from running. We will use two reg files DisableOneDriveExplorerDisable.reg and DisableOneDriveFileSync.reg to disable OneDrive and remove explorer icon. However, before you can apply the registry, you will need to take owenership of the registry key. You can use SetACL.exe Application. see DisableOneDrive.cmd

Disable Default User Profile from running OneDriveSetup

DisableOneDrive.cmd

reg load "hku\Default" "C:\Users\Default\NTUSER.DAT" 
reg delete HKU\default\software\Microsoft\Windows\CurrentVersion\Run /v OneDriveSetup /f
reg unload "hku\Default"

%~dp0SetACL.exe -on "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -ot reg -actn setowner -ownr n:Administrators
%~dp0SetACL.exe -on "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -ot reg -actn ace -ace "n:Administrators;p:full"

reg import %~dp0DisableOneDriveFileSync.reg
reg import %~dp0DisableOneDriveExplorerDisable.reg

Disable OneDrive Explorer

DisableOneDriveExplorerDisable.reg

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}]
@="OneDrive"
"System.IsPinnedToNameSpaceTree"=dword:00000000
"SortOrderIndex"=dword:00000042

Disable OneDrive Group Policy Settings

DisableOneDriveFileSync.reg

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive]
"DisableFileSyncNGSC"=dword:00000001

MDT Application import

  1. Download & Extract Action-DisableOneDrive.zip
  2. Import as Application Action-DisableOneDrive
  3. Run Command: cmd.exe /c DisableOneDrive.cmd
  4. Use as a Task Sequence in your reference / deployment image

Download:

Action-DisableOneDrive.zip

Github Source

comments powered by Disqus