I have a list of proxies with login credentials (user:pass@1.2.3.4:5678). I'm trying to come up with a way rotate these proxies in IE 8.
Attempt 1)
Using python's pywin32 module, I wrote a small script to set the proxies.
from _winreg import *
def setProxy(proxy):
keyVal = 'Software\Microsoft\Windows\CurrentVersion\Internet Settings'
key = OpenKey(HKEY_CURRENT_USER, keyVal, 0, KEY_ALL_ACCESS)
SetValueEx(key, 'ProxyServer', 0, REG_SZ, proxy)
CloseKey(key)
This solution works great for proxies that don't require usernames/passwords. I realized that something was off, because the proxies weren't working.
Attempt 2)
I went into IE
Tools -> Internet Options -> Connections -> Lan Settings -> Advanced I set the proxy to user:pass@1.2.3.4:5678 After clicking "Ok", all of my information that I had entered was missing.
In IE 8, you must enter t开发者_如何转开发he IP/Port ONLY, then open a url. At this point, you are prompted for a username and password. Considering my list of proxies is HUGE, I needed to find a way to set this automatically.
Attempt 3)
I opened up Control Panel -> All Control Panel Items -> Credential Manager and found my existing proxy credentials saved in there.
I found a utility called cmdkey.exe, which is a command line tool of Credential Manager. I tried creating an Proxy Credential, exactly like one of the existing ones (from entering my credentials at the prompt in IE).
C:\Windows\system32>cmdkey /generic:Microsoft_WinInet_1.2.3.4:5678/My Proxy Source /user:USERNAME /pass:PASSWORD
The credential looked identical to my existing ones, so I fired up IE and tried the new proxy. No luck, I was still prompted for my username and password for the proxy.
Where/How do you set the username/password for proxies on IE 8 for Windows 7?
Oddly enough I found that you need to drop the Microsoft_WinInet_
and add LegacyGeneric
. It worked for me. Also using this format I was able to save the intranet password for employees as well. Changed all the information it is a corporate network using AD. The default realm is the domain on ISA proxy server so no /user:Domain\username
. Hope this helps.
command that works:
cmdkey.exe /generic:LegacyGeneric:target=192.168.0.254 /user:account /pass:complexe
using my script that creates 7 passwords at once for everything:
WshShell.run "cmdkey.exe /generic:LegacyGeneric:target=" & proxyIP & " /user:" & user & " /pass:" & password & ""
original command that did not work for me:
cmdkey.exe /generic:Microsoft_WinInet_192.168.0.254:8080/DomainName /user:account /pass:complexe
精彩评论