From Sweltering Treeshrew, 7 Years ago, written in Plain Text.
Embed
  1. @echo off
  2. cls
  3.  
  4. set x86="%SYSTEMROOT%\System32\OneDriveSetup.exe"
  5. set x64="%SYSTEMROOT%\SysWOW64\OneDriveSetup.exe"
  6.  
  7. echo Closing OneDrive process.
  8. echo.
  9. taskkill /f /im OneDrive.exe > NUL 2>&1
  10. ping 127.0.0.1 -n 5 > NUL 2>&1
  11.  
  12. echo Uninstalling OneDrive.
  13. echo.
  14. if exist %x64% (
  15. %x64% /uninstall
  16. ) else (
  17. %x86% /uninstall
  18. )
  19. ping 127.0.0.1 -n 10 > NUL 2>&1
  20.  
  21. echo Removing OneDrive leftovers.
  22. echo.
  23. rd "%USERPROFILE%\OneDrive" /Q /S > NUL 2>&1
  24. rd "C:\OneDriveTemp" /Q /S > NUL 2>&1
  25. rd "%LOCALAPPDATA%\Microsoft\OneDrive" /Q /S > NUL 2>&1
  26. rd "%PROGRAMDATA%\Microsoft OneDrive" /Q /S > NUL 2>&1
  27.  
  28. echo Removing OneDrive from the Explorer Side Panel.
  29. echo.
  30. REG DELETE "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f > NUL 2>&1
  31. REG DELETE "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f > NUL 2>&1
  32.  
  33. pause