VBS Windows代理启用

时间:2017-07-17 14:22:42

标签: vbscript

Option Explicit
Dim objShell, RegLocate

Set objShell = WScript.CreateObject("WScript.Shell")
RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"
objShell.RegWrite RegLocate,"0","REG_DWORD"

WScript.Sleep 1000

If "REG_DWORD" = "" then
CreateObject("WScript.Shell").RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet\Settings\ProxyEnable Settings\ProxyEnable",1,"REG_DWORD"
else
MsgBox "Proxy alrdy running"
end if
WScript.Quit

所以我的问题不是获取代理设置,我有脚本,它的工作原理。问题是在IE浏览器中启用它。

脚本运行并且没有出错...所以我碰到了墙。

抱歉语法和英语不好。

0 个答案:

没有答案