@ECHO OFF & PUSHD %~DP0 & TITLE
>NUL 2>&1 REG.exe query "HKU\S-1-5-19" || (
    ECHO SET UAC = CreateObject^("Shell.Application"^) > "%TEMP%\Getadmin.vbs"
    ECHO UAC.ShellExecute "%~f0", "%1", "", "runas", 1 >> "%TEMP%\Getadmin.vbs"
    "%TEMP%\Getadmin.vbs"
    DEL /f /q "%TEMP%\Getadmin.vbs" 2>NUL
    Exit /b
)
SET /P ST=输入a添加右键菜单，输入d删除右键菜单：
if /I "%ST%"=="a" goto Add
if /I "%ST%"=="d" goto Remove
:Add
if "%PROCESSOR_ARCHITECTURE%"=="x86"  reg add "HKEY_CLASSES_ROOT\*\shell\EditPlus"         /t REG_SZ /v "" /d "用 EditPlus 打开"   /f
if "%PROCESSOR_ARCHITECTURE%"=="x86"  reg add "HKEY_CLASSES_ROOT\*\shell\EditPlus"         /t REG_EXPAND_SZ /v "Icon" /d "%~dp0editplus.exe" /f
if "%PROCESSOR_ARCHITECTURE%"=="x86"  reg add "HKEY_CLASSES_ROOT\*\shell\EditPlus\command" /t REG_SZ /v "" /d "%~dp0editplus.exe \"%%1\"" /f
If "%PROCESSOR_ARCHITECTURE%"=="AMD64"  reg add "HKEY_CLASSES_ROOT\*\shell\EditPlus"         /t REG_SZ /v "" /d "用 EditPlus 打开"   /f
If "%PROCESSOR_ARCHITECTURE%"=="AMD64"  reg add "HKEY_CLASSES_ROOT\*\shell\EditPlus"         /t REG_EXPAND_SZ /v "Icon" /d "%~dp0editplus64.exe" /f
If "%PROCESSOR_ARCHITECTURE%"=="AMD64"  reg add "HKEY_CLASSES_ROOT\*\shell\EditPlus\command" /t REG_SZ /v "" /d "%~dp0editplus64.exe \"%%1\"" /f
 
exit
:Remove
reg delete "HKEY_CLASSES_ROOT\*\shell\EditPlus" /f
exit 