Skip to content

Instantly share code, notes, and snippets.

@GZShi
Created October 9, 2012 13:04
Show Gist options
  • Save GZShi/3858689 to your computer and use it in GitHub Desktop.
Save GZShi/3858689 to your computer and use it in GitHub Desktop.
a simple bat file for switch hosts to ipv4 or ipv6
cd %windir%\system32\drivers\etc
if exist hosts (rename hosts hosts.ipv4) else rename hosts.ipv4 hosts
if exist hosts (echo now:hosts) else echo now:hosts.ipv4
ipconfig /flushdns
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment