@ECHO OFF&PUSHD %~DP0 &TITLE 绿化
Rd "%WinDir%\system32\test_permissions" >NUL 2>NUL
Md "%WinDir%\System32\test_permissions" 2>NUL||(Echo 请使用右键管理员身份运行！&&Pause >nul&&Exit)
Rd "%WinDir%\System32\test_permissions" 2>NUL
SetLocal EnableDelayedExpansion
:Menu
echo.&echo +.创建桌面百度网盘
echo.&echo 1.注册浏览器关联下载控件
echo.&echo 2.注册右键上传备份项控件
echo.&echo.
set /p a=输入数字回车：
IF NOT "%a%"=="" SET a=%a:~0,1%
if "%a%"=="+" Goto DesktopLnk
if "%a%"=="1" Goto AddWebDetect
if "%a%"=="2" Goto AddYunShell
echo.&echo 输入无效，请重新输入！ 
PAUSE >NUL && CLS && GOTO Menu
:AddWebDetect
regsvr32 /s npYunWebDetect.dll
start "YunDetectService.exe"
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v lin /t REG_SZ /d “%~dp0\YunDetectService.exe” /f  >NUL 2>NUL
CLS &ECHO.&ECHO 注册完成，任意键返回！&PAUSE >NUL && CLS && GOTO MENU
:AddYunShell
if exist "%WinDir%\SysWOW64" regsvr32 /s YunShellExt64.dll
if not exist "%WinDir%\SysWOW64" regsvr32 /s YunShellExt.dll
CLS &ECHO.&ECHO 注册完成，任意键返回！&PAUSE >NUL && CLS && GOTO MENU
:DesktopLnk
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\百度网盘.lnk""):b.TargetPath=""%~dp0BaiduYunGuanjia.exe"":b.WorkingDirectory=""%~dp0"":b.Save:close")
CLS &ECHO.&ECHO 创建完成，任意键返回！&PAUSE >NUL && CLS && GOTO MENU