彻底卸载Windows系统OneDrive脚本

将以下代码复制到文本中,保存成bat,右键以管理员身份执行即可

卸载32位OneDrive脚本

%SystemRoot%\System32\OneDriveSetup.exe /uninstall 
taskkill /F /IM explorer.exe 
takeown /f %UserProfile%\OneDrive 
icacls %UserProfile%\OneDrive /grand Administrator:F 
takeown /f %LocalAppData%\Microsoft\OneDrive 
icacls %LocalAppData%\Microsoft\OneDrive /grand Administrator:F 
takeown /f %ProgramData%\Microsoft OneDrive 
icacls %ProgramData%\Microsoft OneDrive /grand Administrator:F 
RD "%UserProfile%\OneDrive" /Q /S 
RD "%LocalAppData%\Microsoft\OneDrive" /Q /S 
RD "%ProgramData%\Microsoft OneDrive" /Q /S 
RD "C:\OneDriveTemp" /Q /S 
REG Delete "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f 
REG Delete "HKEY_USERS\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run\OneDriveSetup" /f 
explorer

卸载64位OneDrive脚本

%SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall 
taskkill /F /IM explorer.exe 
takeown /f %UserProfile%\OneDrive 
icacls %UserProfile%\OneDrive /grand Administrator:F 
takeown /f %LocalAppData%\Microsoft\OneDrive 
icacls %LocalAppData%\Microsoft\OneDrive /grand Administrator:F 
takeown /f %ProgramData%\Microsoft OneDrive 
icacls %ProgramData%\Microsoft OneDrive /grand Administrator:F 
RD "%UserProfile%\OneDrive" /Q /S 
RD "%LocalAppData%\Microsoft\OneDrive" /Q /S 
RD "%ProgramData%\Microsoft OneDrive" /Q /S 
RD "C:\OneDriveTemp" /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 
REG Delete "HKEY_USERS\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run\OneDriveSetup" /f 
explorer

原文链接

你可能感兴趣的:(资源,工具类,windows,onedrive,microsoft)