Enable/Disable Proxy Server by Shortcut

It is common to have Proxy server settings enabled in office.  But we need to disable it when we are outside.  How to quickly switch the proxy settings?

  1. Create two text files 
    1. ProxyEnable.ps1:  
      Set-itemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyEnable -Value 1
    2. ProxyDisable.ps1:
      Set-itemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyEnable -Value 0
  2. Many corporate computer has PowerShell disabled by group policy.  Therefore, we need to create a Desktop shortcuts as below, so that it can be executed.
    1. powershell -ExecutionPolicy ByPass -File ProxyEnable.ps1
    2. powershell -ExecutionPolicy ByPass -File ProxyDisable.ps1


Popular Posts