批处理来源网上。

@rem OneDrive Complete uninstaller batch process for Windows 10.
@rem Run as administrator to completely delete all OneDrive components and files.
@rem Written by TERRA Operative - 2016/08/31. V1.2
@rem Feel free to distribute freely as long as you leave this entire file unchanged and intact,
@rem and if you do make changes and adaptions, don't be a dick about attributing where due.
@rem And most importantly, peace out and keep it real. @echo OFF @REM Set variables for coloured text
SETLOCAL EnableDelayedExpansion
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
set "DEL=%%a"
) echo ------Windows 10 OneDrive Uninstaller V1.2------
echo. @rem This code block detects if the script is being running with admin privileges. If it isn't it pauses and then quits.
NET SESSION >nul 2>&1
IF %ERRORLEVEL% EQU 0 ( echo Administrator Privileges Detected!
echo.
) ELSE ( echo.
call :colorEcho 0C "########### ERROR - ADMINISTRATOR PRIVILEGES REQUIRED #############"
echo.
call :colorEcho 0C "# #"
echo.
call :colorEcho 0C "#"
call :colorEcho 07 " This script must be run as administrator to work properly."
call :colorEcho 0C " #"
echo.
call :colorEcho 0C "#"
call :colorEcho 07 " If you're seeing this after clicking on a start menu icon,"
call :colorEcho 0C " #"
echo.
call :colorEcho 0C "#"
call :colorEcho 07 " then right click on the file and select 'Run As Administrator'"
call :colorEcho 0C " #"
echo.
call :colorEcho 0C "# #"
echo.
call :colorEcho 0C "###################################################################"
echo.
echo. PAUSE
EXIT /B 1
) echo -----------------------------------------------
call :colorEcho 0C " WARNING"
echo.
call :colorEcho 0C " This script will completely and permanently"
echo.
call :colorEcho 0C " remove OneDrive from your computer."
echo.
call :colorEcho 0C " Make sure all OneDrive documents"
echo.
call :colorEcho 0C " that are stored locally are fully"
echo.
call :colorEcho 0C " backed up before proceeding."
echo.
echo -----------------------------------------------
echo. SET /P M= Press 'Y' to continue or any other key to exit.
if %M% ==Y goto PROCESSKILL
if %M% ==y goto PROCESSKILL EXIT /B 1 @rem The following is based on info from here written by 'LK':
@rem https://techjourney.net/disable-or-uninstall-onedrive-completely-in-windows-10/ @rem Terminate any OneDrive process
:PROCESSKILL
echo.
echo Terminating OneDrive process. taskkill /f /im OneDrive.exe @rem Detect if OS is 32 or 64 bit
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=32BIT || set OS=64BIT if %OS%==32BIT GOTO 32BIT
if %OS%==64BIT GOTO 64BIT @rem Uninstall OneDrive app
:32BIT
echo.
echo This is a 32-bit operating system.
echo Removing OneDrive setup files. %SystemRoot%\System32\OneDriveSetup.exe /uninstall
GOTO CLEAN :64BIT
echo.
echo This is a 64-bit operating system.
echo Removing OneDrive setup files. %SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall
GOTO CLEAN @rem Clean and remove OneDrive remnants
:CLEAN
echo.
echo Removing remaining OneDrive folders. rd "%UserProfile%\OneDrive" /Q /S
rd "%LocalAppData%\Microsoft\OneDrive" /Q /S
rd "%ProgramData%\Microsoft OneDrive" /Q /S
rd "C:\OneDriveTemp" /Q /S echo.
call :colorEcho 0C "If you see 'access denied' errors here, reboot and run this batch file again."
echo. @rem Delete and remove OneDrive in file explorer folder tree registry key
echo.
echo Removing OneDrive registry keys. IF EXIST "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" REG Delete "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f
IF EXIST "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" REG Delete "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f
REG ADD "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v System.IsPinnedToNameSpaceTree /d "0" /t REG_DWORD /f echo.
echo OneDrive Uninstall and cleaning completed.
echo. PAUSE
echo So long and thanks for all the fish...
PING -n 2 127.0.0.1>nul
EXIT /B 1 @rem Settings for text colour :colorEcho
echo off
<nul set /p ".=%DEL%" > "%~2"
findstr /v /a:%1 /R "^$" "%~2" nul
del "%~2" > nul 2>&1i

彻底卸载Windows 10中OneDrive的更多相关文章

  1. 如何完全禁用或卸载Windows 10中的OneDrive - 51CTO.COM

    OneDrive 是微软的个人云存储平台,提供了对个人用户的文件托管.存储和同步等服务,OneDrive 默认被内置在 Windows 10 操作系统当中,而且当用户使用 微软账户 登录时,OneDr ...

  2. 如何完全禁用或卸载Windows 10中的OneDrive

    该功能占用很大的内存与CPU 详见http://os.51cto.com/art/201508/489371.htm

  3. [转载]在 Windows 10 中, 如何卸载和重新安装 OneNote App

    在 Windows 10 中, 如何卸载和重新安装 OneNote App 15/8/2015 使用 PowerShell 命令卸载 OneNote App 开始菜单 -> 输入 "P ...

  4. 【翻译】Windows 10 中为不同设备加载不同页面的3种方法

    在以前,为PC和手机做App是两个工程,PC和手机各一个.在Windows 10中会发现只有一个了,对于简单的页面变化可以使用VisualState来解决,但是比如网易云音乐这种PC版和手机版差异巨大 ...

  5. 在Windows 10中截取截图的6种方式 简介

    在Windows 10中截取截图的6种方式 简介 截图对于不同的目的很重要.它可以用于捕获笔记本电脑上的任何内容的截图.所以,如果你使用Windows 10,你可能不知道如何截图,因为它是比较新的.因 ...

  6. 重装助手教你如何在Windows 10中更改您的帐户名称

    当您设置新的Win10免费下载 PC时,您选择用户名的部分可能会让您措手不及.如果是这种情况,您可以选择弹出头部的第一件事或者您打算稍后更改的随机和临时事物.但令人惊讶的是,在Windows 10中更 ...

  7. 如何在 Windows 10 中搭建 Node.js 环境?

    [编者按]本文作者为 Szabolcs Kurdi,主要通过生动的实例介绍如何在 Windows 10 中搭建 Node.js 环境.文章系国内 ITOM 管理平台 OneAPM 编译呈现. 在本文中 ...

  8. Windows 10 中的存储空间

    存储空间有助于保护你的数据免受驱动器故障的影响,并随着你向电脑添加驱动器而扩展存储.你可以使用存储空间将两个或多个驱动器一起分组到一个存储池中,然后使用该池的容量来创建称为存储空间的虚拟驱动器.这些存 ...

  9. [转]如何在Windows 10中更改文件夹背景颜色

    ini文件.我们甚至可以使用相同的技术将图片设置为文件夹背景. 已有工具可以更改Windows 7中Windows资源管理器背景的颜色,并将图像设置为Windows 7中的文件夹背景,但这些工具与Wi ...

随机推荐

  1. linux服务器查看项目日志命令

    1.tailf mywork.log | grep --line-buffered findUserList      实时跟踪日志,这里是只要findUserList 这个方法被运行,就会将它的日志 ...

  2. JS正则表达式分组模式

    分组的概念 分组就是在正则表达式中用()包起来的内容代表了一个分组,如下: var reg=/([0-9]{3})([a-z]{2})/ var str="123ab" conso ...

  3. 7.1 通用的职责分配软件原则 GRASP原则一: 创建者 Creator

    1.GRASP原则一: 创建者 Creator  Who should be responsible for creating a new instance of some class 由谁来负责创 ...

  4. android:Internet(volley)

    public void getStringFromCloud(View view) { /*创建请求队列*/ RequestQueue queue = Volley.newRequestQueue(t ...

  5. web前端性能优化总结一

    转自:http://www.2cto.com/kf/201604/498725.html 网站的划分一般为二:前端和后台.我们可以理解成后台是用来实现网站的功能的,比如:实现用户注册,用户能够为文章发 ...

  6. 2015-10-05 js3

    Javascript 实例2九九乘法表 var s = ""; s += "<table>"; for (var i = 1; i < 10; ...

  7. Vue(八) 数字输入框组件案例

    数字输入框是对普通输入框的扩展,用来快捷输入一个标准的数字,如图: 代码: <div id="app"> <input-number v-model=" ...

  8. with&as上下文管理协议

    通过with 方式调用的方式 class Open: def __init__(self,name): self.name = name def __enter__(self): #with调用的时候 ...

  9. mysql安装和初次密码修改

    下载 第一步:打开网址,https://www.mysql.com,点击downloads之后跳转到https://www.mysql.com/downloads 第二步 :跳转至网址https:// ...

  10. day34-python操作redis三

    Hash类型操作 Hash类型操作 Redis在内存中存储hash类型是以name对应一个字典形式存储的 hset(name,key,value) #name对应的hash中设置一个键值对(不存在,则 ...