批处理来源网上。

@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. PAT 1058 A+B in Hogwarts

    1058 A+B in Hogwarts (20 分)   If you are a fan of Harry Potter, you would know the world of magic ha ...

  2. 使用VMware新建一个Linux系统虚拟机(全)

    我们将其分为两步,1:新建虚拟机:2:安装Red Hat Enterprse Linux 6操作系统 1.首先我们新建一个虚拟机,先不安装操作系统,稍后再对其安装Linux系统. 新建虚拟机步骤如下: ...

  3. app性能测试指标

    性能测试在软件的质量保证中起着重要的作用,它包括的测试内容丰富多样.中国软件评测中心将性能测试概括为三个方面:应用在客户端性能的测试.应用在网络上性能的测试和应用在服务器端性能的测试.通常情况下,三方 ...

  4. .net core WebApi Monitor实现并发同步

    在.net中,还可以使用Monitor实现线程并发同步.Monitor类是纯托管且完全可移植,并且可能会在操作系统资源需求方面更加高效. Monitor的锁对象尽可能使用引用对象,如果是字符串或值对象 ...

  5. OC学习笔记

    备注:这里只是个人的观点,有的地方也是copy,多多指教,个人笔记,有侵犯你们版权的地方还望海涵!!! ARC单例模式的实现 使用alloc方法初始化一个类的实例的时候,默认是调用了 allocWit ...

  6. angular2在ts中使用transform转换时间格式

    摘要:在angular1中我们可以在控制器中像下面那样使用filter: $filter('date')(myDate, 'yyyy-MM-dd'); 但是如何在angular2中在ts中使用自定义p ...

  7. tail语法

    本文介绍Linux下tail命令的使用方法.linux tail命令用途是依照要求将指定的文件的最后部分输出到标准设备,通常是终端,通俗讲来,就是把某个档案文件的最后几行显示到终端上,假设该档案有更新 ...

  8. Java学习笔记34(sql基础 :增删改查1)

    create database qy97;/*创建数据库*/ use qy97; /*使用数据库 use 数据库名*/ show tables; /*查看所有的表*/ select database( ...

  9. Js/如何操作div下面的span元素或者是img之类的标签元素

    $("div[name='MatTypeName']").click(function (e) { $("div[name='MatTypeName']").e ...

  10. 项目三(2)——person与学生

    编程实现Person类,学生类的设计及其继承关系 (同第六章课后第三题) class Person{ private String name; private String addr; private ...