Before running batch file how to detect the available entry in host file
Posted on 2010-11-09
Need urgent help!
I want to update windows hosts file for certain entries like IP-Address & Host-name by a DOS batch script.
But before adding these entries i want to check if any entry already exists in
hosts file or not. If exists, it will not be added.
In hosts file, existing entries i.e. ip and hostname may be separated by white-space
or tab-space which i don't know before hand. So while checking if the entry exists or not i just have to compare the strings ignoring the tab/white-space in between ip and host-name.
Valuable advices will be highly appreciated.