w10install/scripts/uninstall-onedrive.cmd

41 lines
1.3 KiB
Batchfile
Raw Normal View History

2021-01-10 18:45:55 +01:00
@echo off
set x86=%SYSTEMROOT%\System32\OneDriveSetup.exe
set x64=%SYSTEMROOT%\SysWOW64\OneDriveSetup.exe
echo ####### %0 #######
echo KILLING OneDrive ...
taskkill /f /im OneDrive.exe > NUL 2>&1
2021-03-22 00:39:55 +01:00
echo sleep 5 seconds ...
2021-01-10 18:45:55 +01:00
ping 127.0.0.1 -n 5 > NUL 2>&1
echo UNINSTALLING OneDrive ...
if exist %x64% (
2021-03-30 21:21:53 +02:00
%x64% /uninstall 2>nul
2021-01-10 18:45:55 +01:00
) else (
2021-03-30 21:21:53 +02:00
%x86% /uninstall 2>nul
2021-01-10 18:45:55 +01:00
)
2021-03-22 00:39:55 +01:00
echo sleep 5 seconds ...
2021-01-10 18:45:55 +01:00
ping 127.0.0.1 -n 5 > NUL 2>&1
echo CLEANUP OneDrive ...
rd "%USERPROFILE%\OneDrive" /Q /S > NUL 2>&1
rd "C:\OneDriveTemp" /Q /S > NUL 2>&1
rd "%LOCALAPPDATA%\Microsoft\OneDrive" /Q /S > NUL 2>&1
rd "%PROGRAMDATA%\Microsoft OneDrive" /Q /S > NUL 2>&1
echo remove OneDrive from explorer ...
reg DELETE "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f > NUL 2>&1
reg DELETE "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f > NUL 2>&1
reg DELETE "HKEY_CURRENT_USER\Software\Classes\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\ShellFolder" /f > NUL 2>&1
reg DELETE "HKEY_CURRENT_USER\Software\Classes\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\ShellFolder" /f > NUL 2>&1
2021-05-26 22:47:13 +02:00
echo remove update tasks ...
schtasks /Delete /F /TN "OneDrive Standalone Update Task-S-1-5-21-4127453296-551005713-2917436380-500" 2>nul
2021-01-10 18:45:55 +01:00
echo ####### %0 #######