Uninstall the OneDrive Client on Windows 10

If like me, you’ve been searching for way to uninstall the OneDrive client on Windows 10, then you’ve just come to the right place!

Alright it’s not a huge program, and you can disable it, but why should that suffice if it isn’t something I’m going to use?  I can see why Microsoft have implemented it, I just don’t think it was a good idea.

Anyway, here’s how it’s done:

 

The following commands needs to be run in an elevated command prompt.

First of all, force OneDrive to stop running:

taskkill /f /im OneDrive.exe

 

Now to uninstall OneDrive. Run the command relevant to your OS type, ie 32 or 64bit:

32bit - %SystemRoot%\System32\OneDriveSetup.exe /uninstall
64bit - %SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall

 

OneDrive is now removed. However, it’s probably be best to do a bit of house cleaning to remove files left behind. Run the next steps to cleanup any leftover files:

rd "%UserProfile%\OneDrive" /Q /S
rd "%LocalAppData%\Microsoft\OneDrive" /Q /S
rd "%ProgramData%\Microsoft OneDrive" /Q /S
rd "C:\OneDriveTemp" /Q /S

 

Finally, we need to remove OneDrive from the navigation pane of file file explorer by deleting the following reg keys. Either delete manually or run the commands below in the same prompt as above.

REG Delete "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f
REG Delete "HKEY_CLASSES_ROOT\Wow76432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f

 

I’m yet to try this as a startup script to uninstall the OneDrive client on Windows 10 domain computers, but it could probably be done. However I would remove steps 3 & 4 before doing so.

 

 

UPDATE:

As suggested by Bubsy41 in the comments, the following commands will remove the keys from the registry to prevent OneDrive installing its self again:

REG LOAD HKLM\DEFAULT $OSDISK\Users\Default\NTUSER.DAT
reg delete HKLM\default\software\Microsoft\Windows\CurrentVersion\Run /v OneDriveSetup /f
REG ADD “HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce” /v removeonedrive /t REG_SZ /d “%SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall” /f
REG DELETE “HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}” /f
REG DELETE “HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}” /f
REG UNLOAD HKLM\DEFAULT

Personally I was changing the permissions on the OneDriveSetup.exe reference above to deny all for everyone, however this appears to be a more conclusive and permanent way of doing things.

2 Comments


  1. Also run the following to prevent reinstalls:

    REG LOAD HKLM\DEFAULT $OSDISK\Users\Default\NTUSER.DAT

    reg delete HKLM\default\software\Microsoft\Windows\CurrentVersion\Run /v OneDriveSetup /f

    REG ADD “HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce” /v removeonedrive /t REG_SZ /d “%SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall” /f

    REG DELETE “HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}” /f

    REG DELETE “HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}” /f

    REG UNLOAD HKLM\DEFAULT

    Reply

    1. Hi Bubsy – thanks for the update. I’ve been adding deny permissions for Everyone to the OneDriveSetup.exe, but this seems to be a more conclusive method – I’ll add it to the end of the tut!

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *