@echo off set "IP_ADDRESS=127.0.0.1" set "DOMAIN_NAME=erupe.custom" set "HOSTS_PATH=%WINDIR%\System32\drivers\etc\hosts" :: Check if the domain is already in the hosts file findstr /I /C:"%DOMAIN_NAME%" "%HOSTS_PATH%" >nul if %errorlevel% neq 0 ( echo Adding %DOMAIN_NAME% to hosts file... echo %IP_ADDRESS% %DOMAIN_NAME%>> "%HOSTS_PATH%" echo Entry added. ) else ( echo Domain %DOMAIN_NAME% already exists in the hosts file. Skip adding. ) pause