find a word and replace a line with batch file
问题 I have a local server on my Windows XP Virtual Box. Every time my main network changes like from wifi to cable or I move to a different network the IP of my Win XP box changes. I want to run a batch file to map the new IP to some common name in my hosts file C:\WINDOWS\system32\drivers\etc\hosts for example if I have now: 10.97.100.74 www.myAppServer.com and if the ip changes to 192.168.11.9 , I want to search for the string myAppServer in the hosts file and replace the whole line with 192