Skip to content

Instantly share code, notes, and snippets.

@okatu-loli
Last active February 22, 2024 04:56
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save okatu-loli/556533c9d925b80eaff86094d5e949f9 to your computer and use it in GitHub Desktop.
Save okatu-loli/556533c9d925b80eaff86094d5e949f9 to your computer and use it in GitHub Desktop.
临时解决“百度网盘的插件导致 Windows 资源管理器持续占用高 CPU,进而导致资源管理器进程的稳定性下降、系统卡顿”的问题
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
:: 作者: 千石
:: 来源: 蓝点网(https://mp.weixin.qq.com/s/2t9TqXFHkhDcMaVXSvuxnQ)
:: V2EX(https://www.v2ex.com/t/1007324#reply11)
:: 开源地址: https://gist.github.com/okatu-loli/556533c9d925b80eaff86094d5e949f9
echo 作者: 千石
echo 来源: 蓝点网(https://mp.weixin.qq.com/s/2t9TqXFHkhDcMaVXSvuxnQ)
echo V2EX(https://www.v2ex.com/t/1007324#reply11)
echo 开源地址: https://gist.github.com/okatu-loli/556533c9d925b80eaff86094d5e949f9
:: 运行管理员模式
:: 提示用户以管理员身份运行脚本
net session >nul 2>&1
if %errorLevel% neq 0 (
echo 请以管理员身份运行此脚本。
pause
exit
)
:: 提示用户输入百度网盘的安装路径
SET /P BaiduNetdiskDir=请输入百度网盘的安装路径(例如 C:\Users\你的用户名\AppData\Roaming\baidu\BaiduNetdisk):
:: 验证用户输入的路径
IF NOT EXIST "%BaiduNetdiskDir%" (
echo 输入的路径不存在,请检查路径是否正确。
pause
exit
)
:: 输出使用的路径
echo 使用的百度网盘安装路径: %BaiduNetdiskDir%
:: 找到并杀死被 yunshellextv164.dll 注入的进程
echo 正在查找被 yunshellextv164.dll 注入的进程...
for /f "tokens=2" %%a in ('tasklist /m yunshellextv164.dll ^| findstr /i "exe"') do (
echo 找到进程:%%a
echo 正在杀死进程 %%a...
taskkill /F /PID %%a
echo.
)
:: 搜索并尝试删除 yunshellextv164.dll
echo 正在搜索并尝试删除 yunshellextv164.dll...
IF EXIST "%BaiduNetdiskDir%\yunshellextv164.dll" (
del /F /Q "%BaiduNetdiskDir%\yunshellextv164.dll"
echo yunshellextv164.dll 已被删除。
) ELSE (
echo 没有找到 yunshellextv164.dll。
)
:: 启动资源管理器
echo 正在启动资源管理器...
start explorer
echo 脚本执行完毕。
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment