@ECHO OFF&PUSHD %~DP0 &TITLE 绿化卸载
Md "%WinDir%\System32\test_permissions" 2>NUL||(Echo.&Echo 请使用右键"以管理员身份运行"!&&Pause >NUL&&Exit)
Rd "%WinDir%\System32\test_permissions" 2>NUL
SetLocal EnableDelayedExpansion

:Menu
echo.&echo 1.绿化
echo.&echo 2.卸载
echo.&echo 3.设置为默认视频播放器
echo.&echo +.创建桌面PotPlayer
echo.
set /p a=输入数字按回车：
IF NOT "%a%"=="" SET a=%a:~0,1%
if "%a%"=="1" Goto Setup
if "%a%"=="2" Goto Uninst
if "%a%"=="3" Goto RegisterDef
if "%a%"=="+" Goto DesktopLnk
echo.&echo 输入无效，请重新输入！ 
PAUSE >NUL & CLS & GOTO Menu

:Setup
taskkill /f /im PotPlayer*>NUL 2>NUL
Reg Delete HKCU\Software\Daum /F>NUL 2>NUL
>"%tmp%\a.reg" echo REGEDIT4
>>"%Temp%.\a.reg" echo [HKEY_CURRENT_USER\Software\Daum\PotPlayerMini\Settings]
>>"%Temp%.\a.reg" echo "CheckAutoUpdate"=dword:00000000
>>"%Temp%.\a.reg" echo "AutoDownloadFile"=dword:00000000
>>"%Temp%.\a.reg" echo.
regedit /s "%Temp%.\a.reg" &del  "%Temp%.\a.reg"
ECHO.&ECHO 绿化完成，任意键返回！&PAUSE >NUL 2>NUL & CLS & GOTO MENU

:RegisterDef
taskkill /f /im PotPlayer*>NUL 2>NUL
PotPlayerMini.exe /RegisterDef
ECHO.&ECHO 设置完成，任意键返回！&PAUSE >NUL 2>NUL & CLS & GOTO MENU

:Uninst
taskkill /f /im PotPlayer*>NUL 2>NUL
PotPlayerMini.exe /Unregister
Reg Delete HKCU\Software\Daum /F>NUL 2>NUL
ECHO.&ECHO 卸载完成，任意键返回！&PAUSE >NUL 2>NUL & CLS & GOTO MENU

:DesktopLnk
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\PotPlayer.lnk""):b.TargetPath=""%~dp0PotPlayerMini.exe"":b.WorkingDirectory=""%~dp0"":b.Save:close")
ECHO.&ECHO 创建完成，任意键返回！&PAUSE >NUL 2>NUL & CLS & GOTO MENU