批处理来源网上。

@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. npm下设置NODE_ENV下mac与windows的差异

    linux & mac: export NODE_ENV=production windows:set NODE_ENV=production windows: mac:

  2. php 连接oracle 导出百万级数据

    1,我们一般做导出的思路就是,根据我们想要的数据,全部查询出来,然后导出来,这个对数据量很大的时候会很慢,这里我提出来的思想就是分页和缓冲实现动态输出. 2.普通的我就不说了,下面我说一下分页和内存刷 ...

  3. MapServer Configuring with IIS

    MapServer Configuring with IIS 一.前言 1.MapServer简介 MapServer是一个用C语言编写的开源地理数据呈现引擎.除了浏览地理信息系统数据之外,MapSe ...

  4. window service 2008 解决80端口占用

    1.进入cmd使用netstat 命令查看指定端口netstat -ano | findstr :802.如下所示:本地的80端口被进程为4的占用 TCP    0.0.0.0:80          ...

  5. E: Sub-process /usr/bin/dpkg returned an error code (1)错误解决

    在用apt-get安装软件时出现了类似于install-info: No dir file specified; try --help for more information.dpkg:处理 get ...

  6. Permission denied (publickey). fatal: Could not read from remote repository.

    博主在github上下载tiny face的的源代码的时候,遇到git clone命令为:git clone --recursive git@github.com:peiyunh/tiny.git 而 ...

  7. vue学习笔记 - 篇2

    1.借助Vue.extend()方法创建组件 注意点 var Aaa = Vue.extend({ template: "<h1>这是标题</h1>" }) ...

  8. mpvue 转小程序实践总结

    介绍 Mpvue 是一个使用 Vue.js 开发小程序的前端框架.  基础介绍 框架基于 Vue.js 核心,修改了 Vue.js 的 runtime 和 compiler 实现,使其可以运行在小程序 ...

  9. __FILES__

    _FILE_ :被称为PHP魔术常量 ,返回当前执行PHP脚本的完整路径和文件名,包含一个绝对路径 1)dirname(__FILE___) 函数返回的是脚本所在在的路径.   比如文件 b.php ...

  10. 莫烦tensorflow(9)-Save&Restore

    import tensorflow as tfimport numpy as np ##save to file#rember to define the same dtype and shape w ...