Google Host Patch自动获取脚本

来源:互联网 发布:中文版手机灰鸽子软件 编辑:程序博客网 时间:2024/06/12 20:52

来自 https://plus.google.com/102216617437795883914/posts/EzYX2HJjm61

复制代码并保存为*.bat再运行!

@echo offREM 欢迎圈我,在顶栏的"查找人员"处输入Felix Hsu即可REM Patched by logicmdREM 准备工作,先清一下DNS缓存,再备份hostsipconfig /flushdnsclsREM 测试时有的朋友会不耐烦的点掉,咱提示一下:echo Google+ hosts自动修改脚本echo 请稍等一下,正在通过网络获取可用IPREM 然后ping www.google.cn和www.google.com以获取最新的IP,赋值%CNIP%和%COMIP%REM ping ditu.google.cn获取最新的IP,赋值%MAPIP%for /f "tokens=2 delims=[]" %%i in ('ping www.g.cn') do set CNIP=%%ifor /f "tokens=2 delims=[]" %%i in ('ping www.l.google.com') do set COMIP=%%ifor /f "tokens=2 delims=[]" %%i in ('ping ditu.google.cn') do set MAPIP=%%iREM 找到之前改过的行,删掉,很stupid的方法...type %windir%\System32\drivers\etc\hosts|find "#THISISNOTE" /i /v|find "#Google Plus" /i /v|findstr "." >>%windir%\System32\drivers\etc\hosts2ren %windir%\System32\drivers\etc\hosts hosts3ren %windir%\System32\drivers\etc\hosts2 hostsdel hosts3 /s /qREM 为了美观和避免直接在文件末尾添加的惨剧,咱空一行echo.  >>%windir%\System32\drivers\etc\hostsecho #Google Plus >>%windir%\System32\drivers\etc\hostsREM 把获取到的%CNIP%和%COMIP%给写进去,为了方便以后可以删除,加了一个#THISISNOTE 的注释,我实在是想不出怎么做了,望见谅echo %CNIP% plus.google.com  #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %CNIP% talkgadget.google.com  #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %COMIP% picasaweb.google.com  #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %COMIP% lh1.ggpht.com  #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %COMIP% lh2.ggpht.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %COMIP% lh3.ggpht.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %COMIP% lh4.ggpht.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %COMIP% lh5.ggpht.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %COMIP% lh6.ggpht.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %CNIP% lh6.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %CNIP% lh5.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %CNIP% lh4.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %CNIP% lh3.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %CNIP% lh2.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %CNIP% lh1.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %CNIP% plus.google.com.hk  #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %CNIP% s2.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %CNIP% s1.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %CNIP% images1-focus-opensocial.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %CNIP% images2-focus-opensocial.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %CNIP% images3-focus-opensocial.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %CNIP% images4-focus-opensocial.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %CNIP% images5-focus-opensocial.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %CNIP% images6-focus-opensocial.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %CNIP% images-pos-opensocial.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %CNIP% maps-api-ssl.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %CNIP% www.google.com.hk  #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %CNIP% www.google.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %CNIP% webcache.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %CNIP% mail.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %CNIP% www.googlelabs.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %CNIP% docs.google.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %CNIP% plus.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %CNIP% profiles.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %CNIP% services.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %CNIP% clients4.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %CNIP% clients2.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %CNIP% chrome.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts echo %CNIP% tools.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts REM 把获取到的%MAPIP%echo %MAPIP% maps.google.com  #THISISNOTE >>%windir%\System32\drivers\etc\hostsecho %MAPIP% ditu.google.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts  REM ok,搞定echo 您的hosts编辑完成.REM 按任意键继续的功能千万别有,否则别人问你按任意键是神马意思的话...


原创粉丝点击