os windows batch file change a string (hostname) within a file to ip address?
The file is a text file
string is similar to this:
HttpHostPath=http://30544DOG01:8001/
SslHostPath=https://30544DOG01:8002/
I want to replace the host names with ip addresses in the same location as above. So it would look like this.
HttpHostPath=http://10.23.25.2:8001/
SslHostPath=https://10.23.25.2:8002/
We have many to do and I am trying to automate some of this.
FOR /F "tokens=2 delims=[]" %%F IN ('PING -4 -n 1 %machine%') DO SET "PCIP=%%F"
ECHO %PCIP%>>"C:inifile.ini"