@echo off
set /p url=请输入域名地址:
set /p ip=请输入IP地址:
set hosts=%systemroot%\System32\drivers\etc\hosts
attrib -h -s -r "%hosts%"
(echo %ip%    %url%)>>"%hosts%"
attrib +h +r +s "%hosts%"
ipconfig /flushdns
pause
                            
                                著作权归作者所有。
                                商业转载请联系作者获得授权,非商业转载请注明出处。
                                作者:JefskyWong    ——程序猿甜品店
                                链接:https://www.jefsky.com/blog/262 
                                来源:https://www.jefsky.com/