@ECHO OFF

cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && reg query "HKU\S-1-5-19" 1>nul 2>nul || (  cmd /u /c echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && ""%~s0"" %Apply%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )

echo.&echo 正在初始化UPnP服务（UPnP的NAT端口映射）
sc config SSDPSRV start= demand

echo.&echo 正在创建比特彗星磁盘提速服务增强IO性能
set BitComet=%~dp0
sc delete BITCOMET_HELPER_SERVICE >NUL 2>NUL
sc create BITCOMET_HELPER_SERVICE BinPath="%BitComet%tools\BitCometService.exe -service" DisplayName="BitComet磁盘提速服务"
sc description BITCOMET_HELPER_SERVICE "该服务增强了BitComet的磁盘IO性能。"

ECHO.&ECHO 完成 &TIMEOUT /t 3 >NUL&EXIT