Jump to content

howto?? disable IE proxy for few minutes then re-enable???? help


Recommended Posts

Here is a bit of background, as to why i would want to disable the proxy server for a few minutes, then re enable it.

at work we have a proxy server for laptop's and work station. When laptop users work out the office and connect to a (hosted) wifi hotspot, e.g. when you open a internet explorer you are redirected to enter a user name + password to gain access to the internet.

Because we have the proxy server, users are not able to see the login page.

So we want to run a .exe that will edit the registry to disable the proxy server, launch ie ( so user's can log into a hosted wifi )

once say 3 minutes has passed, we need to re enabe the proxy BUT.. with out closing I.E down.

I have seen a way todo this to force the machine to re-read the registry, but lack the knoledge on how todo this, can anyone HELP????? please.

This is what i have done in a batch file so far.. if any one can help a massive THANK YOU in advance.

@echo off

cls

set reg=HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings

Reg Add "%reg%" /v "ProxyEnable" /t "REG_DWORD" /d "0" /f

start iexplore http://www.google.co.uk

::Wait and add reg key 1

Timeout /T 120

Reg Add "%reg%" /v "ProxyEnable" /t "REG_DWORD" /d "1" /f

Link to comment
Share on other sites

" proxy BUT.. with out closing I.E down ..."

Mmmh,

that may be only possible if you use "Internetoptions" direct. You can try:

rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl,,4

in combination with controlsend (and move it out of the visible screen).

I did something like that with regional settings, to change from point to comma and back.

But that was only for me, as IT-Guy I would avoid solutions like that.

HTH, Reinhard

Link to comment
Share on other sites

OK, just trying to sort this out manually for the moment.

Here is the latest code i have , if i run the scripts seperatly they work fine, if i want the script to run in the background, and sat run the proxy off after 2 minutes is does not work ;) can anyone help ??

#include <IE.au3>

$PXYSVR = "ccventures.omniquad.com"

$PXYPRT = "8080"

$key = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"

$reg = RegWrite($key, "ProxyEnable", "REG_DWORD", "0")

$reg1 = RegWrite($key, "ProxyServer", "REG_SZ", $PXYSVR & ":" & $PXYPRT)

DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)

Sleep(2000)

$oIE = _IECreate("http://www.google.co.uk")

Sleep(8000)

;;PROXY OFF

$key = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"

$reg = RegWrite($key, "ProxyEnable", "REG_DWORD", "1")

DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)

Sleep(2000)

Link to comment
Share on other sites

  • 6 months later...

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...