This procedure seems incomplete. where does it pushes the detected host to hosts file.
Code:
cd C:\Windows\System32\drivers\etc & sed s/#// hosts > tmp & mv tmp hosts
cd C:\Windows\System32\drivers\etc & sed "s/^/#/" hosts > tmp & mv tmp hosts
These two lines just comment and uncomment all hosts in the file.