I read this topic First step which was usefull to begin with. I can add several lines into my hosts file.
I am now trying, without success, to search and replace a string with regular expression. For exemple, if my host file contains "SOMEIP website.com" I would like to modify this line to obtain "NEWIP website.com".
I can find if a line contains "website.com", I currently don't know (if possible) how to get that line and replace the IP address via a regular expression pattern.
%windir%\system32\FIND /C /I "website.com" %hostpath% >nul
IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^%server% website.com>>%hostpath%
I'm lost so thank you for your answers :)