@ECHO OFF&PUSHD %~DP0 &TITLE PotPlayer关联设置
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 +.创建桌面快捷方式图标
echo.&echo -.清理注册表信息并取消关联
echo.
set /p a=输入提示性字符后按回车：
IF NOT "%a%"=="" SET a=%a:~0,1%
if "%a%"=="1" Goto NoUpdate
if "%a%"=="2" Goto RegisterDef
if "%a%"=="3" Goto RegisterAll
if "%a%"=="+" Goto DesktopLnk
if "%a%"=="-" Goto DelReg
echo.&echo 输入无效，请重新输入！
PAUSE >NUL & CLS & GOTO Menu

:NoUpdate
taskkill /f /im PotPlayer* >NUL 2>NUL
Reg Delete HKCU\Software\Daum /f >NUL 2>NUL
Reg Add HKCU\Software\Daum\PotPlayerMini\Settings /v CheckAutoUpdate /t REG_DWORD /d 0 /f >NUL 2>NUL
Reg Add HKCU\Software\Daum\PotPlayerMini\Settings /v AutoDownloadFile /t REG_DWORD /d 0 /f >NUL 2>NUL
Reg Add HKCU\Software\Daum\PotPlayerMini\Settings /v CheckAutoUpdate /t REG_DWORD /d 0 /f >NUL 2>NUL
Reg Add HKCU\Software\Daum\PotPlayerMini\Settings /v AutoDownloadFile /t REG_DWORD /d 0 /f >NUL 2>NUL

ECHO.&ECHO 已关闭自动更新，任意键返回！&PAUSE >NUL 2>NUL & CLS & GOTO MENU

:RegisterDef
taskkill /f /im PotPlayer* >NUL 2>NUL
PotPlayerMini64.exe /RegisterDef
ECHO.&ECHO 关联常用视频格式文件完成，任意键返回！&PAUSE >NUL 2>NUL & CLS & GOTO MENU

:RegisterAll
taskkill /f /im PotPlayer* >NUL 2>NUL
PotPlayerMini64.exe /RegisterAll
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

:DelReg
taskkill /f /im PotPlayer* >NUL 2>NUL
PotPlayerMini64.exe /Unregister
Reg Delete HKCU\Software\Daum /f >NUL 2>NUL
ECHO.&ECHO 清理完成，任意键返回！&PAUSE >NUL 2>NUL & CLS & GOTO MENU