Skip to content

Instantly share code, notes, and snippets.

@macrotea
Created May 21, 2014 07:52
Show Gist options
  • Save macrotea/75c486f1e6eb93c14145 to your computer and use it in GitHub Desktop.
Save macrotea/75c486f1e6eb93c14145 to your computer and use it in GitHub Desktop.
基于bat命令添加hosts
@echo off
rem author: macrotea@qq.com / @Macrotea / macrotea.cn
:: get ip and site
set /p ip=ip:
set /p site=site:
:: write
echo. >>C:\Windows\System32\drivers\etc\hosts
echo.%ip% %site% >>C:\Windows\System32\drivers\etc\hosts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment