@Echo Off&Title 百度网盘
cd /d %~dp0
mode con cols=42 lines=22
color 2F
>nul 2>&1 REG.exe query "HKU\S-1-5-19" || (
    ECHO SET UAC = CreateObject^("Shell.Application"^) > "%TEMP%\Getadmin.vbs"
    ECHO UAC.ShellExecute "%~f0", "%1", "", "runas", 1 >> "%TEMP%\Getadmin.vbs"
    "%TEMP%\Getadmin.vbs"
    DEL /f /q "%TEMP%\Getadmin.vbs" 2>nul
    Exit /b
)
:Menu
Cls
Echo.
Echo.&Echo     绿化 → 1
Echo.&Echo     卸载 → 2
Echo.
:Menu
Set /p a=输入数字按回车：
If "%a%"=="1" Goto In
If "%a%"=="2" Goto Un
Echo.&Echo 输入无效，请重新输入！
pause >nul
Goto Menu
:In
taskkill /f /im BaiduNetdisk.exe >nul 2>nul
taskkill /f /im YunDetectService.exe >nul 2>nul
regsvr32 /s npYunWebDetect.dll
start /wait /B "" "YunDetectService.exe" reg
reg add "HKCU\Software\Baidu\BaiduYunGuanjia" /v "installDir" /t REG_SZ /d "%~dp0\" /f >nul
reg add "HKCU\Software\Baidu\BaiduYunGuanjia" /v "Version" /t REG_SZ /d "5.5.4.1" /f >nul
if "%PROCESSOR_ARCHITECTURE%"=="x86" reg add "HKLM\SOFTWARE\Baidu\BaiduYunGuanjia" /v "installDir" /t REG_SZ /d "%~dp0\" /f >nul
if "%PROCESSOR_ARCHITECTURE%"=="x86" reg add "HKLM\SOFTWARE\Baidu\BaiduYunGuanjia" /v "Version" /t REG_SZ /d "5.5.4.1" /f >nul
If "%PROCESSOR_ARCHITECTURE%"=="AMD64" reg add "HKLM\SOFTWARE\Wow6432Node\Baidu\BaiduYunGuanjia" /v "installDir" /t REG_SZ /d "%~dp0\" /f >nul
If "%PROCESSOR_ARCHITECTURE%"=="AMD64" reg add "HKLM\SOFTWARE\Wow6432Node\Baidu\BaiduYunGuanjia" /v "Version" /t REG_SZ /d "5.5.4.1" /f >nul
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\百度网盘.lnk""):b.TargetPath=""%~dp0BaiduNetdisk.exe"":b.WorkingDirectory=""%~dp0"":b.Save:close")
Goto fanhui
:Un
taskkill /f /im BaiduNetdisk.exe >nul 2>nul
regsvr32 /s /u npYunWebDetect.dll
regsvr32 /s /u YunShellExt.dll
if exist "%WinDir%\SysWOW64" regsvr32 /s /u YunShellExt64.dll
start /wait /B "" "YunDetectService.exe" unreg
taskkill /f /im YunDetectService.exe >nul 2>nul
del /f /q "AppSettingApp.dat" >nul 2>nul
del /f /q "AppProperty.xml" >nul 2>nul
del /f /q "config.ini" >nul 2>nul
del /f /q "crossdomain.dat" >nul 2>nul
rd /s /q "%AppData%\BaiduYunGuanjia" >nul 2>nul
rd /s /q "%AppData%\BaiduYunKernel" >nul 2>nul
rd /s /q "%AppData%\BaiduYunKongMing" >nul 2>nul
rd /s /q "%AppData%\Baidu\BaiduNetdisk" >nul 2>nul
reg delete "HKCU\Software\Baidu\BaiduYunGuanjia" /f >nul 2>nul
reg delete "HKLM\SOFTWARE\Baidu\BaiduYunGuanjia" /f >nul 2>nul
reg delete "HKLM\SOFTWARE\Wow6432Node\Baidu\BaiduYunGuanjia" /f >nul 2>nul
reg delete "HKCR\CLSID\{679F137C-3162-45da-BE3C-2F9C3D093F64}" /f >nul 2>nul
reg delete "HKCU\Software\Classes\CLSID\{679F137C-3162-45da-BE3C-2F9C3D093F64}" /f >nul 2>nul
reg delete "HKLM\SOFTWARE\Classes\CLSID\{679F137C-3162-45da-BE3C-2F9C3D093F64}" /f >nul 2>nul
reg delete "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{679F137C-3162-45da-BE3C-2F9C3D093F64}" /f >nul 2>nul
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{679F137C-3162-45da-BE3C-2F9C3D093F64}" /f >nul 2>nul
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{679F137C-3162-45da-BE3C-2F9C3D093F64}" /f >nul 2>nul
reg delete "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{679F137C-3162-45da-BE3C-2F9C3D093F64}" /f >nul 2>nul
del /q "%userprofile%\Desktop\百度网盘.lnk" >nul 2>nul
Goto fanhui
:fanhui
Echo.&Echo                完成...
ping -n 2 10>nul
goto menu

