:: Purpose : Disable/Enable Hosts blocking file :: Version : 1.0 :: Note : Windows XP-only version :: : OS-detection condition could be added or different versions of this script :: : written for different OS :: : Windows XP C:\WINDOWS\SYSTEM32\DRIVERS\ETC :: : Windows 2K C:\WINNT\SYSTEM32\DRIVERS\ETC :: : Win 98\ME C:\WINDOWS :: Requires : Administrative Privileges on NT/XP :: Note2 : The main Hosts file is kepted and managed in ZTree folder in this version :: #ZTSet _INSTALLMODE Custom-made hosts file 1:Enable 2:Disable & restore defaults 3:Edit IF [%_INSTALLMODE%] ==[1] goto Install IF [%_INSTALLMODE%] ==[2] goto Uninstall IF [%_INSTALLMODE%] ==[3] goto EditHosts goto exit :Install %SYSTEMDRIVE% cd "%SYSTEMROOT%\system32\drivers\etc" IF NOT EXIST=="Hosts.ORI" copy hosts hosts.ori copy /Y "#ZTHome\Hosts" hosts goto exit :Uninstall %SYSTEMDRIVE% cd "%SYSTEMROOT%\system32\drivers\etc" IF NOT EXIST="Hosts.ORI" goto :NothingToDO copy /Y hosts.ori hosts goto exit :NothingToDO echo No original Host file to restore from pause goto exit :EditHosts :: Edit to your favorite text editor. Note that Notepad may not be appropriate for that file :: (can be large text file + Notepad add a unrequired *.txt suffix start #ZTHome\PSPAD\PSpad.exe "#ZTHome\Hosts"