Hello all.
I have a issue with that we have a Proxy server hard coded into out IE, but when a user log's into a WiFi hotspot, the user is not able to access the Hotspot page to enter the username & password ( do to our proxy settings )
I can up with a script to disable our proxy settings for 2 minutes, then reactivate.... but the DELAY is not working in the script any ideas please.. many thanks
PS i would like this done all in the background, so the user is not aware what is happening..
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f
start iexplore http://www.google.co.uk
PAUSE 120
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
PAUSE SCRIPT In WIN 7 & WIN XP Issues....
Moderator: DosItHelp
Re: PAUSE SCRIPT In WIN 7 & WIN XP Issues....
The PAUSE command does not take any command line arguments. It requires the users to press a key to continue. Windows Vista & 7 have the TIMEOUT command. That would allow you to pause the script for a set amount of time.
Your other option is to use the PING trick.
ping -n 2 -w 60 127.0.0.1>NUL
Your other option is to use the PING trick.
ping -n 2 -w 60 127.0.0.1>NUL
Re: PAUSE SCRIPT In WIN 7 & WIN XP Issues....
As Squashman said
the code will be like that:
[Edited]
if it is not nessacary to launch the internet explorer remove:
and replace with:
this will launch the defualt browser
the code will be like that:
[Edited]
Code: Select all
@echo off
cls
set reg=HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings
Reg Add "%reg%" /v "ProxyEnable" /t "REG_DWORD" /d "0" /f
::Explorer launch
c:
cd\
start /min %ComSpec% /c "%systemdrive%\Program Files\Internet Explorer\iexplore.exe" google.co.uk
::Wait and add reg key 1
Timeout /T 120
Reg Add "%reg%" /v "ProxyEnable" /t "REG_DWORD" /d "1" /f
if it is not nessacary to launch the internet explorer remove:
Code: Select all
::Explorer launch
c:
cd\
start /min %ComSpec% /c "%systemdrive%\Program Files\Internet Explorer\iexplore.exe" google.co.uk
and replace with:
Code: Select all
start http://www.google.co.uk
this will launch the defualt browser
Last edited by abc0502 on 21 Mar 2012 10:21, edited 2 times in total.
-
- Posts: 7
- Joined: 06 Mar 2012 08:02
Re: PAUSE SCRIPT In WIN 7 & WIN XP Issues....
WOW - Thanks for your help!
I have an issue, that the proxy server only takes effect if the IE is restarted. Is there a way to enforce this without restarting IE????
Thanks
I have an issue, that the proxy server only takes effect if the IE is restarted. Is there a way to enforce this without restarting IE????
Thanks
Re: PAUSE SCRIPT In WIN 7 & WIN XP Issues....
here is a suggestion:
what if we make the script earlier add the "0" value then start the ie and wait 120 second and then add the "1" value then restart the explorer?
if that could help you in your problem try this: (the same script but add new codes)
Note: I Changed the Code In my first post so the cmd windows disappear after the code finish
you can change the time it wait that exist after "/T" with seconds
what if we make the script earlier add the "0" value then start the ie and wait 120 second and then add the "1" value then restart the explorer?
if that could help you in your problem try this: (the same script but add new codes)
Code: Select all
@echo off
cls
set reg=HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings
Reg Add "%reg%" /v "ProxyEnable" /t "REG_DWORD" /d "0" /f
::Explorer launch
c:
cd\
start /min %ComSpec% /c "%systemdrive%\Program Files\Internet Explorer\iexplore.exe" google.co.uk
::Wait and add reg key 1
Timeout /T 120
Reg Add "%reg%" /v "ProxyEnable" /t "REG_DWORD" /d "1" /f
::Restart IE
Timeout /T 2
Taskkill /F /im iexplore.exe
Timeout /T 2
start /min %ComSpec% /c "%systemdrive%\Program Files\Internet Explorer\iexplore.exe" google.co.uk
Note: I Changed the Code In my first post so the cmd windows disappear after the code finish
you can change the time it wait that exist after "/T" with seconds