增加hosts记录

发布日期 2024-01-04

@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