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

taskkill /f /im potplayer* /t >NUL 2>NUL
start /wait PotPlayerMini64.exe /Unregister

rd/s/q "%AppData%\Daum"2>NUL
rd/s/q "%AppData%\PotPlayerMini"2>NUL
rd/s/q "%AppData%\PotPlayerMini64"2>NUL

del/q "%Public%\Desktop\PotPlayer.lnk" >NUL 2>NUL
del/q "%UserProfile%\Desktop\PotPlayer.lnk" >NUL 2>NUL
rd/s/q "%AppData%\Microsoft\Windows\Start Menu\Programs\PotPlayer"2>NUL
rd/s/q "%ProgramData%\Microsoft\Windows\Start Menu\Programs\PotPlayer"2>NUL

reg delete "HKLM\Software\Daum" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\PotPlayerMini.exe" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\PotPlayerMini64.exe" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PotPlayer" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PotPlayer" /f /reg:32 >NUL 2>NUL

::备份选项配置
regedit /e "!)选项配置.reg" HKEY_CURRENT_USER\Software\Daum\PotPlayerMini64 >NUL 2>NUL
    
CLS&ECHO.&ECHO 清除完成，确认删除？
ECHO.&ECHO 1、删除软件备份保存选项配置
ECHO.&ECHO 2、删除软件以及清除选项配置
CHOICE /C 12 /N >NUL 2>NUL

IF "%ERRORLEVEL%"=="2" (
 reg delete "HKCU\Software\Daum" /f >NUL 2>NUL
 PUSHD .. & RD /S/Q "%~DP0" >NUL 2>NUL)
  
IF "%ERRORLEVEL%"=="1" (
 rd /s/q Playlist 2>NUL
 rd /s/q Capture 2>NUL
 del MediaInfo.sdb /f >NUL 2>NUL
  FOR /F "delims=*" %%a IN ('dir /a/b *.*^|findstr /v /i "选项配置"') DO ( RD /S/Q "%%a" >NUL 2>NUL & DEL /F/Q "%%a" >NUL 2>NUL )
)