Thursday, September 29, 2011

Prox on, Prox off: Windows Proxy On, Windows Proxy Off with PowerShell



These four files will give you the ability to switch between
having a proxy server set in Windows and not having one set 
without having to navigate a bunch of windows each time. 

Because Windows won't allow a PowerShell script to execute by 
default the scripts are called using batch files so the execution 
policy can be altered before and after calling the script.


proxyon.ps1:

set-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name MigrateProxy -value 1
set-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name ProxyEnable -value 1
set-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name ProxyHttp1.1 -value 0
set-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name ProxyServer -value 'http://10.1.10.109:3128'
set-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name ProxyOverride -value '<local>'

proxyoff.ps1:

set-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name MigrateProxy -value 1
set-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name ProxyEnable -value 0
set-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name ProxyHttp1.1 -value 0
set-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name ProxyServer -value ''
set-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name ProxyOverride -value '<local>'



poff.bat:
 
powershell {Set-ExecutionPolicy Unrestricted}
powershell "& C:\proxyoff.ps1"
powershell {Set-ExecutionPolicy Restricted}

pon.bat:

powershell {Set-ExecutionPolicy Unrestricted}
powershell "& C:\proxyon.ps1"
powershell {Set-ExecutionPolicy Restricted}
 

19 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. This comment has been removed by a blog administrator.

    ReplyDelete
  4. This comment has been removed by a blog administrator.

    ReplyDelete
  5. Presently when you surf the web from a proxy, your proxy server will comprehend that you are perusing a solitary site. mexico web proxy

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. By doing this, you can pick between a few servers accessible to you and select the one with minimum association time.https://novavpn.com/blog/popcorn-time/ You ought to likewise pick the server which is nearest to you.

    ReplyDelete
  8. I know your aptitude on this. I should say we ought to have an online discourse on this. Composing just remarks will close the talk straight away! What's more, will confine the advantages from this data.  Learn more

    ReplyDelete
  9. I am looking for and I love to post a comment that "The content of your post is awesome" Great work visit website

    ReplyDelete
  10. I real glad to uncover this web internet site on bing, just what I was searching for. privacyonline.com.br

    ReplyDelete
  11.  A portable fish finder is a good choice if you don't fish from the same ship all the time. getmoreprivacy.com

    ReplyDelete
  12. Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!. lemigliorivpn.com

    ReplyDelete
  13. In the event that that doesn't work control cycle your Cable/DSL modem and switches and reboot your PC again after the system gadgets are up and stable. https://www.router-reset.com/how-clear-cache-ie11/

    ReplyDelete
  14. Free proxies allow you to view any website and surf anonymously. This blog post was absolutely fantastic. online proxy

    ReplyDelete
  15. I like this post,And I figure that they having a great time to peruse this post,they might take a decent site to make an information,thanks for sharing it to me. https://www.lesmeilleursvpn.com

    ReplyDelete
  16. Amazingly accommodating post. This is my first time i visit here. I found such an extensive number of captivating stuff in your blog especially its trade. Genuinely its unprecedented article. Keep it up. bezoek website

    ReplyDelete
  17. This altogether cuts costs while for the most part improving the quality of administration. prywatnoscwsieci.pl

    ReplyDelete
  18. I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post. Hats off to you! The information that you have provided is very helpful. Klik hier

    ReplyDelete
  19. These parameters can be settled on the measure of traffic stream you are hoping to your website. VPS brings quicker stacking of pages and snappier exchanges on your website. hosting

    ReplyDelete