If = 0 Then
GetI = -1
Else
GetI = CInt((0))
End If
Call YourCode()
'Write all the agents you got in a text file (), the format is one line per: ip:port
IPS = CreateObject("").OpenTextFile("", 1, True).ReadAll
IPS = Split(IPS, vbCrLf)
For IPS_I = 0 To UBound(IPS)
If IPS_I > GetI Then
IPTemp = Split(IPS(IPS_I), ":")
ChangeProxy IPTemp(0), IPTemp(1)
Set WshShell = CreateObject("")
("cscript " & & " " & IPS_I)
End If
Next
Sub YourCode()
'Your code
End Sub
'Use WMI Change IE Proxy
Function ChangeProxy(IP, Port)
'Get the computer name
'Set oNetwork = ("")
'computername=
On Error Resume Next
Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set objShare = ("Win32_Proxy.ServerName='computername'")
Set objInParam = objShare.Methods_("SetProxySetting").inParameters.SpawnInstance_()
objInParam.Properties_.Item("ProxyPortNumber") = Port
objInParam.Properties_.Item("ProxyServer") = IP
Set objOutParams = ("Win32_Proxy.ServerName='computername'", "SetProxySetting", objInParam)
End Function