Título: LockUrl 5.1
Publicado por: carlitos.dll en 5 Septiembre 2008, 19:42 pm
Publico este script ultra-mejorado. ::Lock Url 5.1 ::by Carlos ::Accepts parameter by the name of a text file with a list of urls set FILE= %SystemRoot%\system32\drivers\etc\hosts set findstr=" %WinDir%\system32\findstr.exe" set find=" %WinDir%\system32\find.exe" :start :lock set /p option=Enter option: if [" %option%"]==["1"] (goto add ) if [" %option%"]==["3"] (goto show ) set option | %findstr% " | & ^ > < # $ ' ` . ; , / \ + - ~ ! ) ( ] [ } { : style="color: #b100b1; font-weight: bold;">? *" >NUL 2>&1 && goto lock if " %errorlevel%"=="9009" (goto lock ) :show type "%FILE%" | %findstr% /b /v "#" | sort | more set /p delurl="Enter Url to del: " set delurl | %findstr% " | & ^ > < # $ ' ` ; , \ + ~ ! ) ( ] [ } { ? *" >NUL 2 >&1 && goto del :yesoryes echo You joined address to del: %delurl% set /p confirm="Is that correct? [y/n/cancel]: " set confirm | %find% """" >NUL 2 >&1 && goto yesoryes set confirm | %find% " " >NUL 2 >&1 && goto yesoryes set confirm | %findstr% " | & ^ > < # $ ' ` . ; , / \ + - ~ ! ) ( ] [ } { : style="color: #b100b1; font-weight: bold;">? *" >NUL 2>&1 && goto yesoryes if " %errorlevel%"=="9009" (goto yesoryes ) if /i " %confirm%"=="y" (goto find ) if /i " %confirm%"=="cancel" (goto lock ) :find type " %FILE%" | %findstr% /i " %delurl%$" >nul && (cd. >" %FILE%.bak" ||goto message type "%FILE%" | %findstr% /i /v "%delurl%$">"%FILE%.bak" echo The url has been deleted. :add set /p url="Enter Url to add: " set url | %findstr% " | & ^ > < # $ ' ` ; , \ + ~ ! ) ( ] [ } { ? *" >NUL 2 >&1 && goto add if " %errorlevel%"=="9009" (goto add ) :yesorno echo You joined address to add: %url% set /p confirm="Is that correct? [y/n/cancel]: " set confirm | %find% """" >NUL 2 >&1 && goto yesorno set confirm | %find% " " >NUL 2 >&1 && goto yesorno set confirm | %findstr% " | & ^ > < # $ ' ` . ; , / \ + - ~ ! ) ( ] [ } { : style="color: #b100b1; font-weight: bold;">? *" >NUL 2>&1 && goto yesorno if " %errorlevel%"=="9009" (goto yesorno ) if /i " %confirm%"=="y" (goto verify_0 ) if /i " %confirm%"=="n" (goto add ) if /i " %confirm%"=="cancel" (goto lock ) :attrib attrib -r -h -s " %FILE%" >NUL||goto message ) :mode :argmode :verify_0 if /i " %url:~0,4%"=="www." (goto with0 ) :verify_1 set url | %findstr% " | & ^ > < # $ ' ` ; , \ + ~ ! ) ( ] [ } { ? *" >NUL 2 >&1 && goto:eof if " %errorlevel%"=="9009" (goto:eof ) if /i " %url:~0,4%"=="www." (goto with1 ) :with0 :without0 :with1 echo %IP% %url:~4%>>" %FILE%" ||goto message echo %IP% www. %url:~4%>>" %FILE%" ||goto message echo The url has been added. :without1 echo %IP% www. %url%>>" %FILE%" ||goto message echo The url has been added. :again set /p again="Add other url? [y/n]" if /i " %again%"=="y" (goto add ) if /i " %again%"=="n" (goto lock ) :logo cls echo \--------------------/ echo \--------------------/ :message ::Lock Url 5.1 ::by Carlos
Título: Re: LockUrl 5.1
Publicado por: Darioxhcx en 5 Septiembre 2008, 21:47 pm
esta parte no mas entiendo :P
set option= echo Options: echo - 1 Add url echo - 2 Del url echo - 3 Show urls echo - 4 Exit
ajjajaj nah joda , esta muy bueno aunque no lo mire detenidamente muy bueno como siempre man saludos
Título: Re: LockUrl 5.1
Publicado por: Nakp en 5 Septiembre 2008, 22:03 pm
hay algo que no hace bien... borrar una url con www
si agrego www.url.ltd agrega tambien url.ltd... pero si borro www.url.ltd no se borra la otra
por lo demás bastante bueno el script
salu2
|