@ECHO OFF
REG QUERY "HKU\S-1-5-19">NUL 2>&1||powershell -Command "Start-Process '%~sdpnx0' -Verb RunAs"&&exit

:Menu
ECHO.&ECHO. 1.保留之前配置
ECHO.&ECHO. 2.配置保存到注册表
ECHO.&ECHO. 3.配置保存到INI文件
ECHO.
SET /P Options=请选择配置保存位置（1，2，3）：
IF /I "%Options%"=="1" GOTO LNK
IF /I "%Options%"=="2" GOTO REG
IF /I "%Options%"=="3" GOTO INI
ECHO.&ECHO.选择无效，请重新输入！
timeout /t 2 >NUL
CLS
GOTO Menu

:REG
DEL /F/Q PotPlayerMini64.ini >NUL 2>NUL
Reg.exe add "HKCU\SOFTWARE\DAUM\PotPlayerMini64\Positions" /v "ChatWindowVisible" /t REG_DWORD /d "0" /f >NUL
Reg.exe add "HKCU\SOFTWARE\DAUM\PotPlayerMini64\Positions" /v "PlayListWindowVisible" /t REG_DWORD /d "0" /f >NUL
Reg.exe add "HKCU\SOFTWARE\DAUM\PotPlayerMini64\Settings" /v "AutoDownloadFile" /t REG_DWORD /d "0" /f >NUL
Reg.exe add "HKCU\SOFTWARE\DAUM\PotPlayerMini64\Settings" /v "CheckAutoUpdate" /t REG_DWORD /d "0" /f >NUL
Reg.exe add "HKCU\SOFTWARE\DAUM\PotPlayerMini64\Settings" /v "MouseLeftSClick" /t REG_DWORD /d "4" /f >NUL
Reg.exe add "HKCU\SOFTWARE\DAUM\PotPlayerMini64\Settings" /v "MouseLeftDClick" /t REG_DWORD /d "1" /f >NUL
Reg.exe add "HKCU\SOFTWARE\DAUM\PotPlayerMini64\Settings" /v "MouseMiddleClick" /t REG_DWORD /d "22" /f >NUL
Reg.exe add "HKCU\SOFTWARE\DAUM\PotPlayerMini64\Settings" /v "StartScreenSize" /t REG_DWORD /d "3" /f >NUL
Reg.exe add "HKCU\SOFTWARE\DAUM\PotPlayerMini64\Settings" /v "StartScreenSizeUserW" /t REG_DWORD /d "741" /f >NUL
Reg.exe add "HKCU\SOFTWARE\DAUM\PotPlayerMini64\Settings" /v "StartScreenSizeUserH" /t REG_DWORD /d "371" /f >NUL
Reg.exe add "HKCU\SOFTWARE\DAUM\PotPlayerMini64\Settings" /v "CheckAutoUpdate" /t REG_DWORD /d "0" /f >NUL
Reg.exe add "HKCU\SOFTWARE\DAUM\PotPlayerMini64\Settings" /v "AutoDownloadFile" /t REG_DWORD /d "0" /f >NUL
IF %ERRORLEVEL%==0 (
ECHO.&ECHO 绿化完成&timeout /t 2 >nul&CLS&GOTO LNK
) ELSE (
ECHO.&ECHO 绿化失败&timeout /t 2 >nul&CLS&GOTO Menu
)

:INI
ECHO [Positions] >> PotPlayerMini64.ini
ECHO ChatWindowVisible=0 >> PotPlayerMini64.ini
ECHO PlayListWindowVisible=0 >> PotPlayerMini64.ini
ECHO [Settings] >> PotPlayerMini64.ini
ECHO AutoDownloadFile=0 >> PotPlayerMini64.ini
ECHO CheckAutoUpdate=0 >> PotPlayerMini64.ini
ECHO MouseLeftDClick=1 >> PotPlayerMini64.ini
ECHO MouseLeftSClick=4 >> PotPlayerMini64.ini
ECHO MouseMiddleClick=22 >> PotPlayerMini64.ini
ECHO StartScreenSize=3 >> PotPlayerMini64.ini
ECHO StartScreenSizeUserH=371 >> PotPlayerMini64.ini
ECHO StartScreenSizeUserW=741 >> PotPlayerMini64.ini
IF %ERRORLEVEL%==0 (
ECHO.&ECHO 绿化完成&timeout /t 2 >nul&CLS&GOTO LNK
) ELSE (
ECHO.&ECHO 绿化失败&timeout /t 2 >nul&CLS&GOTO Menu
)

:LNK
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\PotPlayer.lnk""):b.TargetPath=""%~dp0PotPlayerMini64.exe"":b.WorkingDirectory=""%~dp0"":b.Save:close")

:ASSOC
ECHO.&ECHO.是否关联所有媒体格式？
ECHO.&ECHO.[是] 请按任意键，[否] 直接关掉本窗口！&PAUSE >NUL
START "" /WAIT "%~dp0PotPlayerMini64.exe" /RegisterAll

:Finish
ECHO.&ECHO.绿化完成，任意键关闭！&ECHO.
ECHO.BY OSSSR.COM&timeout /nobreak /t 2 >NUL&EXIT