脚本切换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

你可能感兴趣的:(脚本切换windows IP 和 IE 代理)