Licoy / fetch-github-hosts

🌏 同步github的hosts工具,支持多平台的图形化和命令行,内置客户端和服务端两种模式~ | Synchronize GitHub hosts tool, support multi-platform graphical and command line, built-in client and server modes
https://hosts.gitcdn.top
GNU General Public License v3.0
1.15k stars 123 forks source link

windows10一键更新脚本 #6

Closed ACbye closed 1 year ago

ACbye commented 1 year ago
@echo off
set curpath=%~dp0
cd %curpath%
set filename=hosts
set url=https://hosts.gitcdn.top/hosts.txt
powershell curl -o "%filename%" "%url%"
copy .\%filename% C:\Windows\System32\drivers\etc\hosts
ipconfig /flushdns
youxuecao commented 1 year ago

确实可以把hosts中添加git的ip 但是我hosts原有的东西没了。。。

Licoy commented 1 year ago

这个脚本应该会直接覆盖原文件吧,所以不太建议使用

youxuecao commented 1 year ago

竟然可以联系到作者  脚本确实会替换! 感谢您的提醒。 建议fetch-github-hosts工具能够打开软件后直接启动 因为这样我就可以设置开机自启动了 不知道合不合适 纯粹个人想法

Licoy commented 1 year ago

@youxuecao 可以考虑支持

youxuecao commented 1 year ago

感谢

Licoy commented 1 year ago

a7250bb 中已添加启动时自动获取功能,等下个版本发布即可

Licoy commented 1 year ago

v2.6 中已支持