All pastes #1926866 Raw Edit

CPALead Hosts Block

public text v1 · immutable
#1926866 ·published 2010-08-27 14:48 UTC
rendered paste body
@echo off

:CHECK1
IF %(FIND cpalead.com %SystemRoot%\system32\drivers\etc\hosts) = "cpalead.com" GOTO WRITE1
GOTO ERROR1

:CHECK2
IF %(FIND www.cpalead.com %SystemRoot%\system32\drivers\etc\hosts) = "www.cpalead.com" GOTO WRITE2
GOTO ERROR2

:WRITE1
ECHO "127.0.0.1 cpalead.com" >> %SystemRoot%\system32\drivers\etc\hosts 
ECHO "Added cpalead.com"
GOTO CHECK2

:WRITE2
ECHO "127.0.0.1 www.cpalead.com" >> %SystemRoot%\system32\drivers\etc\hosts 
ECHO "Added www.cpalead.com"
GOTO EXIT0

:ERROR1
ECHO "cpalead.com is already applied!"
GOTO CHECK2

:ERROR2
ECHO "www.cpalead.com is already applied!"
GOTO EXIT0

ECHO "Done."
:EXIT0