Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Remove ALL OneDrive
- # Uninstall
- CMD /C "c:\Windows\SysWOW64\OneDriveSetup.exe /uninstall"
- # take ownership of the re-installer
- CMD /C "takeown.exe /F C:\windows\SysWOW64\OneDriveSetup.exe /A"
- CMD /C "icacls C:\windows\syswow64\OneDriveSetup.exe /grant Administrators:F"
- # Remove
- Remove-Item C:\Windows\SysWOW64\OneDriveSetup.exe -Force
- # Create (a fake .exe, 0 bytes in size)
- New-Item C:\Windows\SysWOW64\OneDriveSetup.exe -Force
- # Deny system write
- CMD /C "icacls C:\Windows\SysWOW64\OneDriveSetup.exe /deny Everyone:W"
- # Clean up random onedrive stuff
- Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive"
- Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive"
- Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "C:\OneDriveTemp"
- Remove-Item -Force -ErrorAction SilentlyContinue "$env:userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk"
- # Remove 'Onedrive folder' from left side of file explorer
- Reg Add "HKLM\Software\Classes\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /T REG_DWORD /V "System.IsPinnedToNameSpaceTree" /D 0 /F
Advertisement
Add Comment
Please, Sign In to add comment