netsh winhttp does not appear to work. Any suggestions why?
I have Win7 Pro totally up-to-date.
I have a batch file in startup folder (programs menu) which works (I know it works as the app starts when expected).
In the batch file is a proxy setting which does not work. After the batch file is run and I then check Internet Settings > LAN Settings the proxy settings are as they were last time I changed them manually.
'netsh winhttp' does not seem to work!
When executed in command it appears to work and does not throw up any error messages. Even 'netsh winhttp show proxy' displays the correct setting but proxy is not changed.
rem ---------------------Start of Batch File-------------------
@echo off
netsh winhttp reset proxy
ping 10.128.168.19 | find "Reply" > nul
if %errorlevel%==0 goto school
:home
start C:\Users\rampet\Desktop\MetroTwit.appref-ms
rem Do Other Stuff
goto exit
:school
netsh winhttp set proxy "proxy.education.netspace.net.au:80"
:exit
exit
rem ---------------------End of Batch File-------------------
June 16th, 2012 7:13pm
1. It pays off to read netsh /? to fing right syntax. here is an excerpt from it:
set proxy myproxy
set proxy myproxy:80 "<local>;bar"
set proxy proxy-server="http=myproxy;https=sproxy:88" bypass-list="*.foo.com"
It would suffice to use
netsh winhttp set proxy proxy.education.netspace.net.au:80
2. This script should be run with elevated rights (Run as Administrator, either from elevated command prompt or Scheduled Task)
Regards
Milos
Free Windows Admin Tool Kit Click here and download it now
June 17th, 2012 5:00am