我在这里有一点挑战:我想创建一个批处理文件,打开一个 IE 浏览器会话到一个特定的 url - 很简单
cd C:\"Program Files (x86)"\"Internet Explorer"
start iexplore.exe http://tumblr.com
挑战:
如何配置该 bat 文件,以便连接通过代理服务器,就像您在 Internet 选项中配置它一样?
谢谢!
我在这里有一点挑战:我想创建一个批处理文件,打开一个 IE 浏览器会话到一个特定的 url - 很简单
cd C:\"Program Files (x86)"\"Internet Explorer"
start iexplore.exe http://tumblr.com
挑战:
如何配置该 bat 文件,以便连接通过代理服务器,就像您在 Internet 选项中配置它一样?
谢谢!
事情比你想象的要简单得多:
rem dos batch to enable proxy
reg update "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable=1"
和
rem dos batch to disable proxy
reg update "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable=0"
你可能想iexplore.exe http://tumblr.com
在这些东西之后添加一些......
所以,reg update some key=value
...更新注册表值。这"
是为了使键名中令人难以置信的现有空格输入一个参数而不是两个参数。
enter code here
最简单的方法 -使用临时 .registry 文件:
代理注册:
Regedit4
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="http://ProxyServername:80"
球棒:
regiedit.exe /s proxy.reg
cd C:\"Program Files (x86)"\"Internet Explorer"
start iexplore.exe http://tumblr.com
编辑
REG ADD HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnableRegKey /v 1
启用代理
REG add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer /v "http://ProxyServername:80"
设置代理服务器
在所有情况下,通过 .bat 更改代理设置都需要管理员权限。