Jump to content

Changing IE proxy settings...


Piyush
 Share

Recommended Posts

One way is with WMI:

GetProxySetting()
SetProxySetting("someproxy.com",8080) 

Func SetProxySetting($myProxyServer , $myProxyPort)
$winmgmts = ObjGet("winmgmts:{impersonationLevel=impersonate}")
$win32_Proxy = $winmgmts.InstancesOf ("win32_Proxy")
Dim $Array[1]
for $Obj in $win32_Proxy
$result = $Obj.SetProxySetting($myProxyServer,$myProxyPort)
$Array[UBound($Array) - 1] = $result
ReDim $Array[UBound($Array) + 1]
next
ReDim $Array[UBound($Array) - 1]
Return $Array
EndFunc

Func GetProxySetting()
$winmgmts = ObjGet("winmgmts:{impersonationLevel=impersonate}")
$win32_Proxy = $winmgmts.InstancesOf ("win32_Proxy")
Dim $Array[1][2]
for $Obj in $win32_Proxy
$Array[UBound($Array) - 1][0] = $Obj.ProxyServer
$Array[UBound($Array) - 1][1] = $Obj.ProxyPortNumber
ReDim $Array[UBound($Array) + 1][2]
next
ReDim $Array[UBound($Array) - 1][2]
Return $Array
EndFunc

Other way is with regedit to modify the keys located in:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings

Link to comment
Share on other sites

One way is with WMI:

GetProxySetting()
SetProxySetting("someproxy.com",8080) 

Func SetProxySetting($myProxyServer , $myProxyPort)
$winmgmts = ObjGet("winmgmts:{impersonationLevel=impersonate}")
$win32_Proxy = $winmgmts.InstancesOf ("win32_Proxy")
Dim $Array[1]
for $Obj in $win32_Proxy
$result = $Obj.SetProxySetting($myProxyServer,$myProxyPort)
$Array[UBound($Array) - 1] = $result
ReDim $Array[UBound($Array) + 1]
next
ReDim $Array[UBound($Array) - 1]
Return $Array
EndFunc

Func GetProxySetting()
$winmgmts = ObjGet("winmgmts:{impersonationLevel=impersonate}")
$win32_Proxy = $winmgmts.InstancesOf ("win32_Proxy")
Dim $Array[1][2]
for $Obj in $win32_Proxy
$Array[UBound($Array) - 1][0] = $Obj.ProxyServer
$Array[UBound($Array) - 1][1] = $Obj.ProxyPortNumber
ReDim $Array[UBound($Array) + 1][2]
next
ReDim $Array[UBound($Array) - 1][2]
Return $Array
EndFunc

Other way is with regedit to modify the keys located in:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings

Thanks for that..

[font="Comic Sans MS"][size="7"]Piyush.....[/size][/font][font="Palatino Linotype"][size="2"]Some Of My Scripts...Cool Font Generator Train Searcher and Tracer[/size][/font]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...