那个 咳~ 不多说了

把下列代码拷贝到记事本,修改记事本的后缀名.txt 成 .bat。

双击这个bat文件就OK啦。

代码不是我写的,从一个朋友那边获得了,他也忘记原作者了,如果知道原作者的欢迎拍砖,这部分作为bat的编写使用练习的范本吧。

@echo off
REM 准备工作,先清一下DNS缓存,再备份hosts
ipconfig /flushdns
clsREM 测试时有的朋友会不耐烦的点掉,咱提示一下:
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=%%i
for /f "tokens=2 delims=[]" %%i in ('ping www.l.google.com') do set COMIP=%%i
for /f "tokens=2 delims=[]" %%i in ('ping ditu.google.cn') do set MAPIP=%%iREM 找到之前改过的行,删掉,很stupid的方法...
if exist %windir%\System32\drivers\etc\hosts3 del %windir%\System32\drivers\etc\hosts3
type %windir%\System32\drivers\etc\hosts|find "#THISISNOTE" /i /v|find "#Google Plus" /i /v|findstr "." >>%windir%\System32\drivers\etc\hosts2
ren %windir%\System32\drivers\etc\hosts hosts3
ren %windir%\System32\drivers\etc\hosts2 hosts
del %windir%\System32\drivers\etc\hosts3REM 为了美观和避免直接在文件末尾添加的惨剧,咱空一行
echo.  >>%windir%\System32\drivers\etc\hosts
echo #Google Plus >>%windir%\System32\drivers\etc\hostsREM 把获取到的%CNIP%和%COMIP%给写进去,为了方便以后可以删除,加了一个#THISISNOTE 的注释,我实在是想不出怎么做了,望见谅
echo %CNIP% plus.google.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% talkgadget.google.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %COMIP% picasaweb.google.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %COMIP% lh1.ggpht.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %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\hosts
echo %CNIP% plus.google.com.hk  #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% s2.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% s1.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% images1-focus-opensocial.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% images2-focus-opensocial.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% images3-focus-opensocial.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% images4-focus-opensocial.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% images5-focus-opensocial.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% images6-focus-opensocial.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% images-pos-opensocial.googleusercontent.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %CNIP% maps-api-ssl.google.com #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo #THISISNOTE >>%windir%\System32\drivers\etc\hosts
echo %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\hosts
echo %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\hosts
echo %MAPIP% ditu.google.com  #THISISNOTE >>%windir%\System32\drivers\etc\hosts  REM ok,搞定
echo 您的hosts编辑完成.
REM 按任意键继续的功能千万别有,别人会问你按任意键是神马...
Pause

转载于:https://www.cnblogs.com/Liangw/archive/2011/11/21/2559932.html

突破XXX,冲上Google+相关推荐

  1. 上Google Adsense个人的一点体验

    最近我想开通一个Google Adsense帐号,因为以前注册过一个Google帐号,所以我以为两个是可以共通的,因为很久没上Google帐号,我记不太清密码了,所以我先是登录了Google,登上去了 ...

  2. 发布上线前,先小秀一把俺的64位浏览器,速度那觉对是杠杠滴,上youtube,上google不费劲

    发布上线前,先小秀一把俺的64位浏览器,速度那觉对是杠杠滴,上youtube,上google不费劲

  3. 请领取你的免费云电脑:微软Windows实验虚拟机,每天可以免费使用两个小时,上Google搜资料很方便

    对于没有国外VPS的我,又需要上Google查学习资料的我来说,简直是天上掉馅饼,不用白不用,下面简单描述说明一下免费申请使用微软(Microsoft)学习实验虚拟机的流程, 微软在在财务和运营应用中 ...

  4. 要想文章上Google搜索引擎首页,SEO 要做好下面7个点优化

    当Google SEO 除了关键字分析,还学会语意判读,你该如何花最少的力气抢占关键字首页?接着,我们会从过往撰写SEO 文章的经验中,汇整出一套SEO 文章的撰写步骤,并且在讲解步骤之前会先一一拆解 ...

  5. windows突破百度云上传限速

    个人博客:https://suveng.github.io/blog/​​​​​​​ 查看原文 突破百度云上传限速 说明:上传慢是正常的,这跟百度云没多大关系,而是你宽带的运营商的事,一般宽带都会有一 ...

  6. 无法定位程序输入点 xxxxx 于动态链接库 xxx.dll 上

    今天编译一个程序,发现Debug版本完全正常编译运行,但是一到Release就出现问题: 1.无法定位程序输入点 xxxx 于动态链接库 xxx.dll 上: 2.我再去检查下xxx.dll ,乍一看 ...

  7. VS运行时无法定位程序输入点xxx于动态链接库xxx.exe上

    对于这个问题在百度上百度了好久,都没有解决,百度上很多都是 无法定位程序输入点xxx于动态链接库xxx.dll上,为了解决这个问题真是走了好多坑,花费了几天时间,试了无数的解决方案,为了后面的uu在这 ...

  8. 我记:交2中,突破boll线上轨,是否继续买入?

    有的股票投资者说,boll指标的分析只有在布林通道内才具有分析的作价值,那么 当股价突破飞跃到boll指标的上轨线后怎么进行分析, 这个时候的上轨线就是支撑线的作用,也就是飞跃布林线的特征之一. 上下 ...

  9. 庆科:从安全设计上突破,云上物联网操作系统进化之路

    2016年初,Facebook的创始人扎克伯格给自己定了一个小目标: 我要亲自设计一款人工智能,用它来管理自己的家,控制家里的电器,为我的工作提供便利. 一年过去,一个名叫Jarvis的系统出现在公众 ...

最新文章

  1. xcode symbol(s) not found for architecture i386错误解决方法
  2. 2014 UESTC暑前集训搜索专题解题报告
  3. Cloudera Manager 4.6 安装部署hadoop CDH集群
  4. JS无法获取display为none的隐藏元素的宽度和高度的解决方案
  5. 编写好代码的10条戒律
  6. 用python将图片写入ppt_用python做ppt服务用于导入图片
  7. 作者:陈威,电子科技大学互联网科学中心硕士生。
  8. [leetcode]5179. 将二叉搜索树变平衡
  9. 如何查看Linux的系统是64位的还是32位的
  10. eve-ng:加载c7200 dynamips镜像
  11. 【如何 在 HTML 页面中显示数学公式】
  12. macOS Catalina10.15.4安装HP Laser Jet1020打印机驱动方法
  13. WebRTC协议学习之一(WebRTC简介)
  14. 12306的问题是技术难题吗
  15. 简单创意的思维导图怎么画
  16. 多地“摇号购房” 开发商迎来了良机?
  17. 欧拉定理及扩展(附证明)
  18. SA387Gr11Cl2是什么材质
  19. 您的连接不是私密连接的解决办法
  20. C语言数据存储-浮点型

热门文章

  1. web表格在css中属性,CSS属性之表格(Table)_html/css_WEB-ITnose
  2. php根据类名字符串,PHP 5.5 新特性 ::class 获取类名字符串
  3. 埃尔米特(Hermite)插值及其MATLAB程序
  4. 【opencv】图像特征与描述
  5. 英文识别 java_Java-百度API的图片文字识别(支持英文)
  6. 基于高斯分布和OneClassSVM的异常点检测
  7. mysql5.7.19下载linux_centos7安装 MySQL5.7.19
  8. python3.7语法错误_Tweepy不会安装在Python3.7上;显示“语法错误”
  9. python正则匹配11个数字_Python正则表达式匹配字符串中的数字
  10. 动物行为检测计算机视觉_当动物行为研究遇见机器视觉——“红外热成像+计算机视觉”动物行为研究系统...