使用bat批處理指令碼自動化佈建IP和IE代理

來源:互聯網
上載者:User

在不同的網路環境間切換時需要手動修改IP和IE代理設定,較為繁瑣,可以通過編寫相應的bat批處理指令碼自動完成配置,做到一鍵切換。以下是一個樣本:

@echo off::echo set ip...::netsh interface ip set address name="本地串連" source=static addr=xxx.xxx.xxx.xxx mask=xxx.xxx.xxx.xxx::echo set gateway....::netsh interface ip set address name="本地串連" source=static gateway=xxx.xxx.xxx.xxx gwmetric=1echo set IE proxy: xxx.xxx.xxx.xxx:8080reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /freg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "xxx.xxx.xxx.xxx:8080" /f::跳過本地地址的Proxy 伺服器reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "<local>" /fecho flash...ipconfig /flushdns

其中xxx.xxx.xxx.xxx為對應屬性的IP。如第11行中的"xxx.xxx.xxx.xxx:8080"為目標Proxy 伺服器的IP和連接埠(8080),兩者都可以根據自己的環境修改。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.