A lot of schools we visit require staff to enable and disable the proxy settings to get internet access on their device when switching between onsite and offsite use. This can not only be a time taking task but can also lead to confusion for the less able users.

We have created a batch file you can either set to run every time the user logs on or just have it as a file on their desktop to allow them to easily set if they are using the device onsite or off-site and then making the necessary changes automatically without going through the internet settings pages.

To use the batch file copy the code below into notepad, change the PROXYURL and PROXYPORT to your sites proxy settings and then save the file as SetProxy.Bat.




@echo off
cls
echo ###############################################################################
echo #                                                                             #
echo #          #### ITSIE Ltd - www.itssie.co.uk - 0845 805 1106 #####            #
echo #                                                                             #
echo ###############################################################################
echo Choose: 
echo [1] I am at work 
echo [2] I am at home 
:choice 
SET /P C=[Please enter a number]? 
for %%? in (1) do if /I "%C%"=="%%?" goto 1 
for %%? in (2) do if /I "%C%"=="%%?" goto 2 


:1 
@ECHO OFF 
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /t REG_SZ /d PROXYURL:PROXYPORT /f

goto end

:2
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f

goto end

:end

 

Disclaimer
The sample scripts are provided AS IS without warranty of any kind. ITSSIE further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall ITSSIE, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if ITSSIE has been advised of the possibility of such damages.