-
-
Save dsisnero/cab5d297d27cc643bb82eb90cb786041 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
##LANにプロキシサーバを使用するかどうかを設定 | |
## | |
require 'Win32/Registry' | |
require 'win32ole' | |
wsh = WIN32OLE.new('WScript.Shell') | |
reg = Win32::Registry::HKEY_CURRENT_USER.open('Software\Microsoft\Windows\CurrentVersion\Internet Settings', Win32::Registry::KEY_ALL_ACCESS) | |
value = reg['ProxyEnable'] | |
if value == 1 | |
reg['ProxyEnable'] = 0 | |
wsh.Popup('proxy off') | |
end | |
if value == 0 | |
reg['ProxyEnable'] = 1 | |
wsh.Popup('proxy on') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment