[code @
OFF
ECHO +++++++++++++++++++++++++++++++
ECHO + BnSBazaar F2 Extension 2.11
ECHO +++++++++++++++++++++++++++++++
SET myhost=%SystemRoot%\System32\drivers\etc\hosts
ECHO. & ECHO. & ECHO + Backing up current `hosts` file...
::::::::::::::::::::::::::::::::::::::::::::::::::
attrib -r %myhost%.backup >nul 2>nul
copy %myhost% %myhost%.backup >nul
ECHO. & ECHO + Disabling Read-only attributes
::::::::::::::::::::::::::::::::::::::::::::::::::
attrib -r %myhost%
:: Remove older entries to prevent duplicate
findstr /v bns.ncsoft.com %myhost%.backup > %myhost%
ECHO. & ECHO + Adding new host to redirect your F2
::::::::::::::::::::::::::::::::::::::::::::::::::
ECHO 104.251.217.88 na-bns.ncsoft.com >> %myhost%
ECHO 104.251.217.88 eu-bns.ncsoft.com >> %myhost%
ECHO 64.25.35.89 na-bns.ncsoft.com >> %myhost%
ECHO 206.127.154.10 eu-bns.ncsoft.com >> %myhost%
ECHO. & ECHO + Enabling Read-only attributes
attrib +r %myhost%
::::::::::::::::::
:: Check result
::::::::::::::::::
ECHO. & ECHO. & ECHO.
TYPE %myhost% | find /C /I "bns.ncsoft.com" >NUL
IF %errorlevel% equ 1 GOTO Notfound
:Found
ECHO ==========
ECHO + Success
ECHO ==========
ECHO Extension has been enabled!
ECHO Please wait for a few minutes for old cache to expire, or
ECHO you can try restarting your game client.
GOTO End
:Notfound
ECHO ===========
ECHO + Fail!
ECHO ===========
ECHO Unable to add new host, please make sure you have:
ECHO * Run this batch file as administrator
ECHO * Disable your antivirus when running this file.
:End
ECHO. & ECHO.
ECHO You can close this window now...
Pause[/code]