Jump to content

Recommended Posts

Posted

Hi,

 

We are finding the OneDrive component a bit of a nuisance on our network, as we use a separate drive mapping program to map a user's OneDrive account to a drive letter. So we've uninstalled OneDrive using the following script:

 

taskkill /f /im OneDrive.exe

%SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall

 

rd "%UserProfile%\OneDrive" /Q /S

rd "%LocalAppData%\Microsoft\OneDrive" /Q /S

rd "%ProgramData%\Microsoft OneDrive" /Q /S

 

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

 

However, it appears to reinstall itself after a while.

 

Any ideas?

Posted

Although I'm yet to try this via a script over a site, I did the same as you except changed permissions to %SystemRoot%\SysWOW64\OneDriveSetup.exe on my personal machine to deny all for everyone (you'll need to take ownership first) and it hasn't returned.

 

I made the assumption it reinstalled from the exe periodically or with Windows Updates... May just be a fluke that it hasn't reinstalled yet for me.

  • Thanks 2
Posted
Although I'm yet to try this via a script over a site, I did the same as you except changed permissions to %SystemRoot%\SysWOW64\OneDriveSetup.exe on my personal machine to deny all for everyone (you'll need to take ownership first) and it hasn't returned.

 

I made the assumption it reinstalled from the exe periodically or with Windows Updates... May just be a fluke that it hasn't reinstalled yet for me.

ive done basically that before on domain pcs. I believe it comes back every time a new user logs on as part of the getting stuff ready screens but if they cant read the install file it just goes past it

  • Thanks 3
Posted

Onedrive setup is in the users run reg key, delete that and it will not install.

Here are my commands to remove onedrive

 

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

 

This is done during deployment so the default user profile effects every user of the machine.

  • Thanks 2
  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...