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

:MENU
ECHO.
ECHO.&ECHO 1、添加资源管理器右键IObitUnlocker菜单项
ECHO.&ECHO 2、删除资源管理器右键IObitUnlocker菜单项
IF EXIST "%WinDir%\System32\CHOICE.exe" CHOICE /C 12 /N >NUL 2>NUL
IF EXIST "%WinDir%\System32\CHOICE.exe" IF "%ERRORLEVEL%"=="2" GOTO RemoveMenu
IF EXIST "%WinDir%\System32\CHOICE.exe" IF "%ERRORLEVEL%"=="1" GOTO AddMenu
IF NOT EXIST "%WinDir%\System32\CHOICE.exe" ECHO.&SET /p choice=输入数字项敲回车键：
IF NOT EXIST "%WinDir%\System32\CHOICE.exe" IF NOT "%choice%"=="" SET choice=%choice:~0,1%
IF NOT EXIST "%WinDir%\System32\CHOICE.exe" IF /I "%choice%"=="1" GOTO AddMenu
IF NOT EXIST "%WinDir%\System32\CHOICE.exe" IF /I "%choice%"=="2" GOTO RemoveMenu
IF NOT EXIST "%WinDir%\System32\CHOICE.exe" ECHO.&ECHO 输入无效 &PAUSE&CLS&GOTO MENU

:AddMenu
regsvr32 /s IObitUnlockerExtension.dll
IF EXIST "%WinDir%\System32\CHOICE.exe" ( 
ECHO.&ECHO 已添加 &TIMEOUT /t 2 >NUL & CLS & GOTO MENU
) ELSE ( 
ECHO.&ECHO 已添加，任意键返回 &PAUSE>NUL&CLS&GOTO MENU) 

:RemoveMenu
regsvr32 /s /u IObitUnlockerExtension.dll
IF EXIST "%WinDir%\System32\CHOICE.exe" ( 
ECHO.&ECHO 已删除 &TIMEOUT /t 2 >NUL & CLS & GOTO MENU
) ELSE ( 
ECHO.&ECHO 已删除，任意键返回 &PAUSE>NUL&CLS&GOTO MENU) 