批处理修改Hosts文件
@echo off set stHosts=127.0.0.1 www.XXX.com FOR /F "eol=# tokens=1 delims=" %%i in (%SystemRoot%\system32\drivers\etc\hosts) do if "%stHosts%"=="%%i" exit echo %stHosts%>> %SystemRoot%\system32\drivers\etc\hosts
保存文件为*.bat,放到“启动”文件夹内(C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp)