コマンドでプロキシのオン・オフ

BATコマンドで経路情報を追加、削除と一緒にプロキシの設定のOn、Offもする。これはONと設定。一行目の最後の1がOnの意味。

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 プロキシサーバーのIPアドレス:ポート番号

reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" /f /v ProxyOverride /t reg_sz /d "172.16.;192.168.;<local>"

OFFにするだけ。

reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" /f /v ProxyEnable /t reg_dword /d 0

最後の0がOFF。Windows10のレジストリを修正。管理者権限が必要。

Windows7ではIEを起動してを入れないとだめみたい。Windows10は大丈夫。

以下でインターネットエクスプローラー/IEを起動して活を入れる。timeoutで10秒後に、taskkillでIEを自動で終了。もし、複数IE(今どき使ってないと思いますが)全部のIEを強制終了します。

start /d "C:\Program Files\Internet Explorer\" iexplore.exe
timeout /t 10
taskkill /im iexplore.exe /f

(Visited 439 times, 1 visits today)

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です