Skip to content

Instantly share code, notes, and snippets.

@77toMARYO
Created March 24, 2014 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save 77toMARYO/9740569 to your computer and use it in GitHub Desktop.
Save 77toMARYO/9740569 to your computer and use it in GitHub Desktop.
##
##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