@echo off
echo.
echo HUNGNP18@FPT.COM
echo ------------------------------
echo Dang chay cau hinh, Vui long cho...
echo. 
net session >nul 2>&1
if %errorlevel% neq 0 (
    echo Can chay Administrator.
    echo.
    pause
    exit
)
set primaryDNS=94.140.14.14
set secondaryDNS=94.140.14.15

for /f "tokens=1,* delims=:" %%A in ('netsh interface show interface ^| findstr /R /C:"Connected"') do (
    for /f "tokens=1,* delims= " %%C in ("%%B") do (
        set adapter=%%C
        call :SetDNS "%%C"
    )
)
goto :eof

:SetDNS
echo Setting DNS for %1
netsh interface ip set dns name=%1 static %primaryDNS%
netsh interface ip add dns name=%1 %secondaryDNS% index=2
goto :eof
