Skip to content

Instantly share code, notes, and snippets.

@frah
Last active Dec 27, 2015
Embed
What would you like to do?
プロキシの設定を有効化するVBScript
Option Explicit
Dim Excel, Com
Set Excel = WScript.CreateObject("Excel.Application")
Excel.Visible = False
rem HWND_BROADCAST = 0xffff
rem WM_SETTINGCHANGE = 0x001a
rem SMTO_NOMAL = 0x0
Com = "CALL(""user32"",""SendMessageTimeoutA"",""JJJJJJJN"",""0xffff""," _
& """0x001a"",0,0,0,1000)"
Excel.ExecuteExcel4Macro(Com)
Com = "CALL(""wininet.dll"",""InternetSetOptionA"",""AJJJJ"",0,"
rem INTERNET_OPTION_SETTINGS_CHANGED = 39
Excel.ExecuteExcel4Macro(Com & "39,0,0)")
rem INTERNET_OPTION_REFRESH = 37
Excel.ExecuteExcel4Macro(Com & "37,0,0)")
Excel.Quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment