@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)

相关文章:

  • 2021-05-19
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
猜你喜欢
  • 2022-01-22
  • 2022-12-23
  • 2021-07-07
  • 2022-02-04
  • 2022-12-23
  • 2021-12-20
  • 2021-06-18
相关资源
相似解决方案