脚本切换windows IP 和 IE 代理

 转自 http://blog.csdn.net/microrain/archive/2007/08/06/1728147.aspx
  1. @echo off
  2. color 1f
  3. title 网络环境切换管理
  4. echo.
  5. echo  *** 设置IP参数,设置IE代理 *** 
  6. echo.
  7. echo.
  8. goto menus~
  9. :menus~
  10. echo.
  11. echo 请选择: 
  12. echo 1 切换到公司网
  13. echo 2 切换到自动获取直接上网
  14. echo.
  15. set /p select=请输入菜单对应数字后回车:
  16. if /i "%select%" == "1" goto neusoft
  17. if /i "%select%" == "2" goto auto
  18. goto menus~
  19. :neusoft
  20. cls
  21. netsh interface ip reset "本地连接"
  22. echo 设置IP...
  23. netsh interface ip add address "本地连接" 192.168.20146 255.255.255.0
  24. echo 设置网关...
  25. netsh interface ip add address "本地连接" gateway=192.168.2.129 gwmetric=1
  26. echo 设置DNS...
  27. netsh interface ip set dns "本地连接" static 202.101.111.41 primary 
  28. del 本地连接
  29. echo 设置IE代理...
  30. @echo    Windows Registry Editor Version 5.00>>r.reg
  31. @echo    [HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet Settings]>>r.reg
  32. @echo    "ProxyEnable"=dword:00000001>>r.reg
  33. regedit /s r.reg
  34. del r.reg
  35. goto exit
  36. :auto
  37. cls
  38. echo 设置IP...
  39. netsh interface ip set address name="本地连接" source=dhcp
  40. echo 设置DNS...
  41. netsh interface ip set dns name="本地连接" source=dhcp
  42. @echo    Windows Registry Editor Version 5.00>>r.reg
  43. @echo    [HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet Settings]>>r.reg
  44. @echo    "ProxyEnable"=dword:00000000>>r.reg
  45. regedit /s r.reg
  46. del r.reg
  47. goto exit
  48. :exit
  49. cls
  50. echo.
  51. cho.
  52. echo.
  53. echo.
  54. echo.
  55. echo                           恭喜!已完成所有设置.
  56. echo.
  57. echo.
  58. echo.
  59. echo.
  60. echo.
  61. echo.
  62. pause
  63. exit

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值