@ECHO OFF&(CD /D "%~DP0")&(REG QUERY "HKU\S-1-5-19">NUL 2>&1)||(powershell -Command "Start-Process '%~snx0' -Verb RunAs"&&exit)
ver|findstr "5\.[0-9]\.[0-9][0-9]*" >NUL && (ECHO 此版不支持Windows XP，请使用v3.2.0.1版本 & PING 127.1 /n 5 >NUL&EXIT)
:: 注册信息
reg add "HKCU\Software\TGRMN Software\Bulk Rename Utility" /f /v "key" /d "144-093-278bru-2060k" >NUL 2>NUL
reg add "HKCU\Software\TGRMN Software\Bulk Rename Utility" /f /v "name" /d "Popeyes~XU/TeamURET" >NUL 2>NUL
reg add "HKLM\SOFTWARE\TGRMN Software\Bulk Rename Utility" /f /v "key" /d "144-093-278bru-2060k" >NUL 2>NUL
reg add "HKLM\SOFTWARE\TGRMN Software\Bulk Rename Utility" /f /v "name" /d "Popeyes~XU/TeamURET" >NUL 2>NUL
reg add "HKCU\Software\TGRMN Software\Bulk Rename Utility\Settings" /f /v "firstrun" /t REG_DWORD /d "0" >NUL 2>NUL
reg add "HKLM\Software\TGRMN Software\Bulk Rename Utility\Settings" /f /v "firstrun" /t REG_DWORD /d "0" >NUL 2>NUL

:Begin
Echo.&Echo 已添加激活信息到注册表激活！
Echo.&Echo [1] 添加文件夹右键菜单 Bulk Rename Utility 项
Echo.&Echo [2] 删除文件夹右键菜单 Bulk Rename Utility 项

CHOICE /C 12 >NUL

if "%errorlevel%"=="1" (
  if /i %PROCESSOR_IDENTIFIER:~0,3%==x86 (
  regsvr32 /s BRUHere.dll
  ) else (
  regsvr32 /s BRUHere64.dll
  )
ECHO.&ECHO 添加完成 & TIMEOUT /t 1 >NUL&CLS&GOTO Begin
)

if "%errorlevel%"=="2" (
  if /i %PROCESSOR_IDENTIFIER:~0,3%==x86 (
  regsvr32 /s /u BRUHere.dll
  ) else (
  regsvr32 /s /u BRUHere64.dll
  )
reg delete "HKCU\Software\TGRMN Software" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\TGRMN Software" /f >NUL 2>NUL
ECHO.&ECHO 删除完成 & TIMEOUT /t 1 >NUL&CLS&GOTO Begin
)