💻
[Windows] InternetオプションのProxyサーバ設定をコマンドで変更
Proxyサーバ設定
自動構成スクリプトをOffにして、ProxyサーバとProxyサーバを使わないドメインを設定
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "AutoConfigURL" /f
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" /f /v ProxyEnable /t reg_dword /d 1
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" /f /v ProxyServer /t reg_sz /d プロキシサーバー:ポート
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" /f /v ProxyOverride /t reg_sz /d "*.localdomain;<local>"
Proxyサーバ設定解除
Proxyサーバの設定を無効化して、自動構成スクリプトをOn
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" /f /v ProxyEnable /t reg_dword /d 0
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "AutoConfigURL" /t REG_SZ /d "<pacファイルのURL>" /f
参考
以下を参考にさせて頂きました。
Internet Explorer 11 の「自動構成スクリプトを使用する」を有効/無効にするレジストリの設定値【共通編】
Internet Explorer のプロキシの設定をコマンドで実行する方法
Discussion