Hace poco que he estado leyendo en le foro sobre los archivos .bat, pero explican tan claramente y bien que he aprendido muchisimo en poco tiempo :D
Por lo que les dejo mi primera gran "creacion" XD (no sirve de mucho, pero se ve bonito :))
Relojito
@echo off
mode con cols=67
mode con lines=20
title . ..:: Reloj ocioso by MxPower ::..
color 0a
goto HORA1
REM ---------------------------------------------------------------------------
:HORA1
cls
set H1=%TIME:~0,1%
if %H1%==0 (goto UHOR-0)
if %H1%==1 (goto UHOR-1)
if %H1%==2 (goto UHOR-2)
:UHOR-0
set "UNOHRU= _ "
set "DOSHRU=³ ³"
set "TREHRU=³_³"
goto HORA2
:UHOR-1
set "UNOHRU= "
set "DOSHRU= ³ "
set "TREHRU= ³ "
goto HORA2
:UHOR-2
set "UNOHRU= _ "
set "DOSHRU= _³"
set "TREHRU=³_ "
goto HORA2
REM ---------------------------------------------------------------------------
:HORA2
set H2=%TIME:~1,1%
if %H2%==0 (goto DHOR-0)
if %H2%==1 (goto DHOR-1)
if %H2%==2 (goto DHOR-2)
if %H2%==3 (goto DHOR-3)
if %H2%==4 (goto DHOR-4)
if %H2%==5 (goto DHOR-5)
if %H2%==6 (goto DHOR-6)
if %H2%==7 (goto DHOR-7)
if %H2%==8 (goto DHOR-8)
if %H2%==9 (goto DHOR-9)
:DHOR-0
set "UNOHRD= _ "
set "DOSHRD=³ ³"
set "TREHRD=³_³"
goto MINU1
:DHOR-1
set "UNOHRD= "
set "DOSHRD= ³ "
set "TREHRD= ³ "
goto MINU1
:DHOR-2
set "UNOHRD= _ "
set "DOSHRD= _³"
set "TREHRD=³_ "
goto MINU1
:DHOR-3
set "UNOHRD= _ "
set "DOSHRD= _³"
set "TREHRD= _³"
goto MINU1
:DHOR-4
set "UNOHRD= "
set "DOSHRD=³_³"
set "TREHRD= ³"
goto MINU1
:DHOR-5
set "UNOHRD= _ "
set "DOSHRD=³_ "
set "TREHRD= _³"
goto MINU1
:DHOR-6
set "UNOHRD= _ "
set "DOSHRD=³_ "
set "TREHRD=³_³"
goto MINU1
:DHOR-7
set "UNOHRD= _ "
set "DOSHRD= ³"
set "TREHRD= ³"
goto MINU1
:DHOR-8
set "UNOHRD= _ "
set "DOSHRD=³_³"
set "TREHRD=³_³"
goto MINU1
:DHOR-9
set "UNOHRD= _ "
set "DOSHRD=³_³"
set "TREHRD= _³"
goto MINU1
REM ---------------------------------------------------------------------------
:MINU1
set M1=%TIME:~3,1%
if %M1%==0 (goto UMIN-0)
if %M1%==1 (goto UMIN-1)
if %M1%==2 (goto UMIN-2)
if %M1%==3 (goto UMIN-3)
if %M1%==4 (goto UMIN-4)
if %M1%==5 (goto UMIN-5)
:UMIN-0
set "UNOMIU= _ "
set "DOSMIU=³ ³"
set "TREMIU=³_³"
goto MINU2
:UMIN-1
set "UNOMIU= "
set "DOSMIU= ³ "
set "TREMIU= ³ "
goto MINU2
:UMIN-2
set "UNOMIU= _ "
set "DOSMIU= _³"
set "TREMIU=³_ "
goto MINU2
:UMIN-3
set "UNOMIU= _ "
set "DOSMIU= _³"
set "TREMIU= _³"
goto MINU2
:UMIN-4
set "UNOMIU= "
set "DOSMIU=³_³"
set "TREMIU= ³"
goto MINU2
:UMIN-5
set "UNOMIU= _ "
set "DOSMIU=³_ "
set "TREMIU= _³"
goto MINU2
REM ---------------------------------------------------------------------------
:MINU2
set M2=%TIME:~4,1%
if %M2%==0 (goto DMIN-0)
if %M2%==1 (goto DMIN-1)
if %M2%==2 (goto DMIN-2)
if %M2%==3 (goto DMIN-3)
if %M2%==4 (goto DMIN-4)
if %M2%==5 (goto DMIN-5)
if %M2%==6 (goto DMIN-6)
if %M2%==7 (goto DMIN-7)
if %M2%==8 (goto DMIN-8)
if %M2%==9 (goto DMIN-9)
:DMIN-0
set "UNOMID= _ "
set "DOSMID=³ ³"
set "TREMID=³_³"
goto FECHA
:DMIN-1
set "UNOMID= "
set "DOSMID= ³ "
set "TREMID= ³ "
goto FECHA
:DMIN-2
set "UNOMID= _ "
set "DOSMID= _³"
set "TREMID=³_ "
goto FECHA
:DMIN-3
set "UNOMID= _ "
set "DOSMID= _³"
set "TREMID= _³"
goto FECHA
:DMIN-4
set "UNOMID= "
set "DOSMID=³_³"
set "TREMID= ³"
goto FECHA
:DMIN-5
set "UNOMID= _ "
set "DOSMID=³_ "
set "TREMID= _³"
goto FECHA
:DMIN-6
set "UNOMID= _ "
set "DOSMID=³_ "
set "TREMID=³_³"
goto FECHA
:DMIN-7
set "UNOMID= _ "
set "DOSMID= ³"
set "TREMID= ³"
goto FECHA
:DMIN-8
set "UNOMID= _ "
set "DOSMID=³_³"
set "TREMID=³_³"
goto FECHA
:DMIN-9
set "UNOMID= _ "
set "DOSMID=³_³"
set "TREMID= _³"
goto FECHA
REM ---------------------------------------------------------------------------
:FECHA
set DIA=%DATE:~0,2%
set MES=%DATE:~3,2%
set ANO=%DATE:~6,4%
goto DEFMES
:DEFMES
if %MES%==1 (set "MFP= Enero ")
if %MES%==2 (set "MFP= Febrero ")
if %MES%==3 (set "MFP= Marzo ")
if %MES%==4 (set "MFP= Abril ")
if %MES%==5 (set "MFP= Mayo ")
if %MES%==6 (set "MFP= Junio ")
if %MES%==7 (set "MFP= Julio ")
if %MES%==8 (set "MFP= Agosto ")
if %MES%==9 (set "MFP=Septiembre")
if %MES%==10 (set "MFP= Octubre ")
if %MES%==11 (set "MFP=Noviembre ")
if %MES%==12 (set "MFP=Diciembre ")
:RELOJ
echo.
echo.
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º²²²²²²²²²²±ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿±²²²²²²²²²²±º
echo º²MxPower²²±³ %UNOHRU% %UNOHRD% %UNOMIU% %UNOMID% ³±²²²²²²²²²²±º
echo º²²²²²²²²²²±³ %DOSHRU% %DOSHRD% . %DOSMIU% %DOSMID% ³±²²²²²²²²²²±º
echo º²²²²²²²²²²±³ %TREHRU% %TREHRD% . %TREMIU% %TREMID% ³±²²²²²²²²²²±º
echo º²²²²²²²²²²±³ ³±²²²²²²²²²²±º
echo º²²²²²²²²²²±ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ±²²²²²²²²²²±º
echo º²²²²²²²²²²±±±±±±±±±±±±±±±±±±±±±±±±²²²²²²²²²²±º
echo º²²²²²²²²°ÚÄÄ¿±°ÚÄÄÄÄÄÄÄÄÄÄ¿±°ÚÄÄÄÄ¿±²²²²²²²²±º
echo º²²²²²²²²°³%DIA%³±°³%MFP%³±°³%ANO%³±²²²²²²²²±º
echo º²²²²²²²²°ÀÄÄÙ±°ÀÄÄÄÄÄÄÄÄÄÄÙ±°ÀÄÄÄÄÙ±²²²²²²²²±º
echo º±±±±±±±²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²±±±±±±±±º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo ÀÄÄÄÄÄÙ ÀÄÄÄÄÄÙ
echo.
echo.
echo.
echo (para actualizar el reloj precione una tecla..)
pause>nul
goto HORA1
Ya se que el codigo es muy largo, pero no supe hacerlo de otra manera X____X
...
Espero que les guste ;D
bye
Esta bueno, me gustó la interfaz. :)
Yo prefiero algo mas rudimentario :
@ECHO OFF
:CODE
CLS;
ECHO:%TIME:~0,8%
GOTO:CODE;
Pero el tuyo esta excelente, saludos.
muy bonita la interfaz me gusto muxo :D
Cita de: faralito en 24 Noviembre 2008, 19:04 PM
muy bonita la interfaz me gusto muxo :D
jeje..ami tambien me gusto la interfaz....esta bonita, y pues de esto del reloj ya habia hehco yo uno hace rato...uno digital,...crees que se podrian combinar ambos ??
Citar@echo off
title Batch Digital Clock - by Smart
color 0a
mode con cols=37 lines=10
:ini
set _1=
set _2=
set _3=
set _4=
set _5=
set _6=
set _7=
set _8=
set _9=
set _0=
set _:=
set hora=%time%
call :show %hora:~0,8%
goto ini
:show
IF [%1] NEQ [] goto s_start
ECHO Sintaxis
ECHO TEXTO string
ECHO Donde string corresponde a lo que sera mostrado
ECHO.
GOTO :eof
:s_start
SET _length=0
SET _sentence=%*
:: Longitud de la frase
SET _substring=%_sentence%
:s_loop
IF not defined _substring GOTO :s_result
::remove the first char from _substring (until it is null)
SET _substring=%_substring:~1%
SET /A _length+=1
GOTO s_loop
:s_result
SET /A _length-=1
:: Acomoda el texto al tamano de la pantalla
for /f "tokens=2" %%G in ('mode ^|find "Columns"') do set/a _window=%%G/6
IF %_length% GTR %_window% set _length=%_window%
:: Pasa por cada uno de los digitos y los guarda en una variable
FOR /L %%G IN (0,1,%_length%) DO call :s_build %%G
:: Ahora muestra las variables
ECHO.
ECHO %_1%
ECHO %_2%
ECHO %_3%
ECHO %_4%
ECHO %_5%
ECHO %_6%
ECHO %_7%
ECHO.
GOTO :EOF
:s_build
:: get the next character
CALL SET _digit=%%_sentence:~%1,1%%%
:: Add the graphics for this digit to the variables
IF "%_digit%"==" " (CALL :s_space) ELSE (CALL :s_%_digit%)
GOTO :EOF
:: Pad digits to -->
:s_0
(SET _1=%_1% ÛÛÛÛ)
(SET _2=%_2% Û Û)
(SET _3=%_3% Û Û)
(SET _4=%_4% Û Û)
(SET _5=%_5% Û Û)
(SET _6=%_6% Û Û)
(SET _7=%_7% ÛÛÛÛ)
GOTO :EOF
:s_1
:: Pad digits to -->
(SET _1=%_1% ÛÛ )
(SET _2=%_2% Û )
(SET _3=%_3% Û )
(SET _4=%_4% Û )
(SET _5=%_5% Û )
(SET _6=%_6% Û )
(SET _7=%_7% ÛÛÛÛ)
GOTO :EOF
:s_2
:: Pad digits to -->
(SET _1=%_1% ÛÛÛÛ)
(SET _2=%_2% Û Û)
(SET _3=%_3% Û)
(SET _4=%_4% ÛÛÛÛ)
(SET _5=%_5% Û )
(SET _6=%_6% Û Û)
(SET _7=%_7% ÛÛÛÛ)
GOTO :EOF
:s_3
:: Pad digits to -->
(SET _1=%_1% ÛÛÛÛ)
(SET _2=%_2% Û)
(SET _3=%_3% Û)
(SET _4=%_4% ÛÛÛÛ)
(SET _5=%_5% Û)
(SET _6=%_6% Û)
(SET _7=%_7% ÛÛÛÛ)
GOTO :EOF
:s_4
:: Pad digits to -->
(SET _1=%_1% Û Û)
(SET _2=%_2% Û Û)
(SET _3=%_3% Û Û)
(SET _4=%_4% ÛÛÛÛ)
(SET _5=%_5% Û)
(SET _6=%_6% Û)
(SET _7=%_7% Û)
GOTO :EOF
:s_5
:: Pad digits to -->
(SET _1=%_1% ÛÛÛÛ)
(SET _2=%_2% Û )
(SET _3=%_3% Û )
(SET _4=%_4% ÛÛÛÛ)
(SET _5=%_5% Û)
(SET _6=%_6% Û Û)
(SET _7=%_7% ÛÛÛÛ)
GOTO :EOF
:s_6
:: Pad digits to -->
(SET _1=%_1% ÛÛ )
(SET _2=%_2% Û )
(SET _3=%_3% Û )
(SET _4=%_4% ÛÛÛÛ)
(SET _5=%_5% Û Û)
(SET _6=%_6% Û Û)
(SET _7=%_7% ÛÛÛÛ)
GOTO :EOF
:s_7
:: Pad digits to -->
(SET _1=%_1% ÛÛÛÛ)
(SET _2=%_2% Û Û)
(SET _3=%_3% Û)
(SET _4=%_4% ÛÛ)
(SET _5=%_5% Û )
(SET _6=%_6% Û )
(SET _7=%_7% Û )
GOTO :EOF
:s_8
:: Pad digits to -->
(SET _1=%_1% ÛÛÛÛ)
(SET _2=%_2% Û Û)
(SET _3=%_3% Û Û)
(SET _4=%_4% ÛÛÛÛ)
(SET _5=%_5% Û Û)
(SET _6=%_6% Û Û)
(SET _7=%_7% ÛÛÛÛ)
GOTO :EOF
:s_9
:: Pad digits to -->
(SET _1=%_1% ÛÛÛÛ)
(SET _2=%_2% Û Û)
(SET _3=%_3% Û Û)
(SET _4=%_4% ÛÛÛÛ)
(SET _5=%_5% Û)
(SET _6=%_6% Û)
(SET _7=%_7% Û)
GOTO :EOF
:s_-
:: Pad digits to -->
(SET _1=%_1% )
(SET _2=%_2% )
(SET _3=%_3% )
(SET _4=%_4% ÛÛÛÛ)
(SET _5=%_5% )
(SET _6=%_6% )
(SET _7=%_7% )
GOTO :EOF
:s_:
:: Pad digits to -->
(SET _1=%_1% )
(SET _2=%_2% Û )
(SET _3=%_3% )
(SET _4=%_4% )
(SET _5=%_5% )
(SET _6=%_6% Û )
(SET _7=%_7% )
GOTO :EOF
Saludos.
Citarjeje..ami tambien me gusto la interfaz....esta bonita, y pues de esto del reloj ya habia hehco yo uno hace rato...uno digital,...crees que se podrian combinar ambos ??
Encantado, pero me tienes que ayudar ya que no entendi mucho tu codigo :-X (muy avansado para mi X___x)
Pero con gusto puedes modificar mi relojito ^^
...
Me alegro que les haya gustado
le he corregido pequeños errores, no mostraba horas menores a 10, y meses menores a 10 y también ahora se actualiza solo.
Nota: Utilizé dos funciones que obtienen en variables separadas, el dia el mes y el año y la hora el minuto y el segundo. Sirven para evitar el problema de por ejemplo si quiero saber el primer carácter de la hora:
utilizo %time:~0,1% pero %time% muestra:
1:04:32,90
entonces el primer caracter en vez de ser 0 es el espacio, también sirve cuando tienes minuto 08, que dentro de un set /a lo toma como octal y por tener 8 da error.
Los cambios son mínimos, además modifiqué el tamaño y el título para que me mostrara la hora igualmente
Ahora sí puedo utilizar mi reloj marca MxPower :D
@echo off
::Version modificada por Carlos
mode con cols=49
mode con lines=16
color 0a
goto HORA1
REM ---------------------------------------------------------------------------
:HORA1
cls
call:getTime
title %hour%:%minute%
if %hour% lss 10 (set H1=0) else (set H1=%hour:~0,1%)
if %H1%==0 (goto UHOR-0)
if %H1%==1 (goto UHOR-1)
if %H1%==2 (goto UHOR-2)
:UHOR-0
set "UNOHRU= _ "
set "DOSHRU=³ ³"
set "TREHRU=³_³"
goto HORA2
:UHOR-1
set "UNOHRU= "
set "DOSHRU= ³ "
set "TREHRU= ³ "
goto HORA2
:UHOR-2
set "UNOHRU= _ "
set "DOSHRU= _³"
set "TREHRU=³_ "
goto HORA2
REM ---------------------------------------------------------------------------
:HORA2
call:getTime
if %hour% lss 10 (set H2=%hour%) else (set H2=%hour:~1,1%)
if %H2%==0 (goto DHOR-0)
if %H2%==1 (goto DHOR-1)
if %H2%==2 (goto DHOR-2)
if %H2%==3 (goto DHOR-3)
if %H2%==4 (goto DHOR-4)
if %H2%==5 (goto DHOR-5)
if %H2%==6 (goto DHOR-6)
if %H2%==7 (goto DHOR-7)
if %H2%==8 (goto DHOR-8)
if %H2%==9 (goto DHOR-9)
:DHOR-0
set "UNOHRD= _ "
set "DOSHRD=³ ³"
set "TREHRD=³_³"
goto MINU1
:DHOR-1
set "UNOHRD= "
set "DOSHRD= ³ "
set "TREHRD= ³ "
goto MINU1
:DHOR-2
set "UNOHRD= _ "
set "DOSHRD= _³"
set "TREHRD=³_ "
goto MINU1
:DHOR-3
set "UNOHRD= _ "
set "DOSHRD= _³"
set "TREHRD= _³"
goto MINU1
:DHOR-4
set "UNOHRD= "
set "DOSHRD=³_³"
set "TREHRD= ³"
goto MINU1
:DHOR-5
set "UNOHRD= _ "
set "DOSHRD=³_ "
set "TREHRD= _³"
goto MINU1
:DHOR-6
set "UNOHRD= _ "
set "DOSHRD=³_ "
set "TREHRD=³_³"
goto MINU1
:DHOR-7
set "UNOHRD= _ "
set "DOSHRD= ³"
set "TREHRD= ³"
goto MINU1
:DHOR-8
set "UNOHRD= _ "
set "DOSHRD=³_³"
set "TREHRD=³_³"
goto MINU1
:DHOR-9
set "UNOHRD= _ "
set "DOSHRD=³_³"
set "TREHRD= _³"
goto MINU1
REM ---------------------------------------------------------------------------
:MINU1
call:getTime
if %minute% lss 10 (set M1=0) else (set M1=%minute:~0,1%)
if %M1%==0 (goto UMIN-0)
if %M1%==1 (goto UMIN-1)
if %M1%==2 (goto UMIN-2)
if %M1%==3 (goto UMIN-3)
if %M1%==4 (goto UMIN-4)
if %M1%==5 (goto UMIN-5)
:UMIN-0
set "UNOMIU= _ "
set "DOSMIU=³ ³"
set "TREMIU=³_³"
goto MINU2
:UMIN-1
set "UNOMIU= "
set "DOSMIU= ³ "
set "TREMIU= ³ "
goto MINU2
:UMIN-2
set "UNOMIU= _ "
set "DOSMIU= _³"
set "TREMIU=³_ "
goto MINU2
:UMIN-3
set "UNOMIU= _ "
set "DOSMIU= _³"
set "TREMIU= _³"
goto MINU2
:UMIN-4
set "UNOMIU= "
set "DOSMIU=³_³"
set "TREMIU= ³"
goto MINU2
:UMIN-5
set "UNOMIU= _ "
set "DOSMIU=³_ "
set "TREMIU= _³"
goto MINU2
REM ---------------------------------------------------------------------------
:MINU2
call:getTime
if %minute% lss 10 (set M2=%minute%) else (set M2=%minute:~1,1%)
if %M2%==0 (goto DMIN-0)
if %M2%==1 (goto DMIN-1)
if %M2%==2 (goto DMIN-2)
if %M2%==3 (goto DMIN-3)
if %M2%==4 (goto DMIN-4)
if %M2%==5 (goto DMIN-5)
if %M2%==6 (goto DMIN-6)
if %M2%==7 (goto DMIN-7)
if %M2%==8 (goto DMIN-8)
if %M2%==9 (goto DMIN-9)
:DMIN-0
set "UNOMID= _ "
set "DOSMID=³ ³"
set "TREMID=³_³"
goto FECHA
:DMIN-1
set "UNOMID= "
set "DOSMID= ³ "
set "TREMID= ³ "
goto FECHA
:DMIN-2
set "UNOMID= _ "
set "DOSMID= _³"
set "TREMID=³_ "
goto FECHA
:DMIN-3
set "UNOMID= _ "
set "DOSMID= _³"
set "TREMID= _³"
goto FECHA
:DMIN-4
set "UNOMID= "
set "DOSMID=³_³"
set "TREMID= ³"
goto FECHA
:DMIN-5
set "UNOMID= _ "
set "DOSMID=³_ "
set "TREMID= _³"
goto FECHA
:DMIN-6
set "UNOMID= _ "
set "DOSMID=³_ "
set "TREMID=³_³"
goto FECHA
:DMIN-7
set "UNOMID= _ "
set "DOSMID= ³"
set "TREMID= ³"
goto FECHA
:DMIN-8
set "UNOMID= _ "
set "DOSMID=³_³"
set "TREMID=³_³"
goto FECHA
:DMIN-9
set "UNOMID= _ "
set "DOSMID=³_³"
set "TREMID= _³"
goto FECHA
REM ---------------------------------------------------------------------------
:FECHA
call:getDate
if %day% lss 10 (set DIA=0%day%) else (set DIA=%day%)
set MES=%month%
set ANO=%year%
goto DEFMES
:DEFMES
if %MES%==1 (set "MFP= Enero ")
if %MES%==2 (set "MFP= Febrero ")
if %MES%==3 (set "MFP= Marzo ")
if %MES%==4 (set "MFP= Abril ")
if %MES%==5 (set "MFP= Mayo ")
if %MES%==6 (set "MFP= Junio ")
if %MES%==7 (set "MFP= Julio ")
if %MES%==8 (set "MFP= Agosto ")
if %MES%==9 (set "MFP=Septiembre")
if %MES%==10 (set "MFP= Octubre ")
if %MES%==11 (set "MFP=Noviembre ")
if %MES%==12 (set "MFP=Diciembre ")
:RELOJ
echo.
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º²²²²²²²²²²±ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿±²²²²²²²²²²±º
echo º²MxPower²²±³ %UNOHRU% %UNOHRD% %UNOMIU% %UNOMID% ³±²²²²²²²²²²±º
echo º²²²²²²²²²²±³ %DOSHRU% %DOSHRD% . %DOSMIU% %DOSMID% ³±²²²²²²²²²²±º
echo º²²²²²²²²²²±³ %TREHRU% %TREHRD% . %TREMIU% %TREMID% ³±²²²²²²²²²²±º
echo º²²²²²²²²²²±³ ³±²²²²²²²²²²±º
echo º²²²²²²²²²²±ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ±²²²²²²²²²²±º
echo º²²²²²²²²²²±±±±±±±±±±±±±±±±±±±±±±±±²²²²²²²²²²±º
echo º²²²²²²²²°ÚÄÄ¿±°ÚÄÄÄÄÄÄÄÄÄÄ¿±°ÚÄÄÄÄ¿±²²²²²²²²±º
echo º²²²²²²²²°³%DIA%³±°³%MFP%³±°³%ANO%³±²²²²²²²²±º
echo º²²²²²²²²°ÀÄÄÙ±°ÀÄÄÄÄÄÄÄÄÄÄÙ±°ÀÄÄÄÄÙ±²²²²²²²²±º
echo º±±±±±±±²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²±±±±±±±±º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo ÀÄÄÄÄÄÙ ÀÄÄÄÄÄÙ
for /f "delims=:,-/ tokens=1-2,5-7" %%a in ("%time%-%date%") do set th1=%%a%%b%%c%%d%%e
:upd
for /f "delims=:,-/ tokens=1-2,5-7" %%a in ("%time%-%date%") do set th2=%%a%%b%%c%%d%%e
if not %th1%==%th2% (goto HORA1) else (goto upd)
::getDate-- crea 3 variables conteniendo el dia, el mes y el año : %%day%% %%month%% %%year%%
::Version: 1.1
::$author: Carlos
:getDate
if [%1]==[] (for /f "tokens=1-3 delims=-/" %%a in ("%date%") do (call :getDate %%a %%b %%c))
if not [%1]==[] (
set /a day=1%1-100
set /a month=1%2-100
set /a year=%3
)
goto:eof
::getTime-- crea 3 variables conteniendo la hora, el minuto y el segundo : %%hour%% %%minute%% %%second%%
::Version: 1.0
::$author: Carlos
:getTime
if [%1]==[] (for /f "tokens=1-3 delims=:," %%a in ("%time%") do (call :getTime %%a %%b %%c))
if not [%1]==[] (
set /a hour=%1
set /a minute=1%2-100
set /a second=1%3-100
)
goto:eof
Wooo... quedo muy bueno :D
gracias carlitos.java =D
Bueno man...ahi te lo modifique...
(http://img291.imageshack.us/img291/1719/clockv2ae0.png)
@echo off
mode con cols=52 lines=20
title Date ^& Clock
color 0a
REM Digital Clock v2
REM Coded by :: SmartGenius ::
REM Original Design by MxPower
:RELOJ
CLS
call :RESET
call :TIEMPO
call :FECHA
echo.
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º±²²²²²²²²²±ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿±²²²²²²²²²±º
echo º±²Smart²²²±³ %UNOHRD% ³±²²²²²²²²²±º
echo º±²²²²²²²²²±³ %DOSHRD% ³±²²²²²²²²²±º
echo º±²²²²²²²²²±³ %TREHRD% ³±²²²²²²²²²±º
echo º±²²²²²²²²²±³ ³±²²²²²²²²²±º
echo º±²²²²²²²²²±ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ±²²²²²²²²²±º
echo º±²²²²²²²²²±±±±±±±±±±±±±±±±±±±±±±±±±±±²²²²²²²²²±º
echo º±²²²²±ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿±²²²²±º
echo º±²²²²±³ %NDAY:~0,3%, %DATE:~-10,2% de %MFP% de %ANO% ³±²²²²±º
echo º±²²²²±ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ±²²²²±º
echo º±±±±±±²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²±±±±±±º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo ÀÄÄÄÄÄÙ ÀÄÄÄÄÄÙ
echo.
pause>nul
GOTO :RELOJ
:RESET
set UNOHRD=
set DOSHRD=
set TREHRD=
GOTO :EOF
:DIGIT-0
set "UNOHRD=%UNOHRD% _ "
set "DOSHRD=%DOSHRD% ³ ³"
set "TREHRD=%TREHRD% ³_³"
goto :EOF
:DIGIT-1
set "UNOHRD=%UNOHRD% "
set "DOSHRD=%DOSHRD% ³ "
set "TREHRD=%TREHRD% ³ "
goto :EOF
:DIGIT-2
set "UNOHRD=%UNOHRD% _ "
set "DOSHRD=%DOSHRD% _³"
set "TREHRD=%TREHRD% ³_ "
goto :EOF
:DIGIT-3
set "UNOHRD=%UNOHRD% _ "
set "DOSHRD=%DOSHRD% _³"
set "TREHRD=%TREHRD% _³"
goto :EOF
:DIGIT-4
set "UNOHRD=%UNOHRD% "
set "DOSHRD=%DOSHRD% ³_³"
set "TREHRD=%TREHRD% ³"
GOTO :EOF
:DIGIT-5
set "UNOHRD=%UNOHRD% _ "
set "DOSHRD=%DOSHRD% ³_ "
set "TREHRD=%TREHRD% _³"
goto :EOF
:DIGIT-6
set "UNOHRD=%UNOHRD% _ "
set "DOSHRD=%DOSHRD% ³_ "
set "TREHRD=%TREHRD% ³_³"
goto :EOF
:DIGIT-7
set "UNOHRD=%UNOHRD% _ "
set "DOSHRD=%DOSHRD% ³"
set "TREHRD=%TREHRD% ³"
goto :EOF
:DIGIT-8
set "UNOHRD=%UNOHRD% _ "
set "DOSHRD=%DOSHRD% ³_³"
set "TREHRD=%TREHRD% ³_³"
goto :EOF
:DIGIT-9
set "UNOHRD=%UNOHRD% _ "
set "DOSHRD=%DOSHRD% ³_³"
set "TREHRD=%TREHRD% _³"
goto :EOF
:DIGIT-:
set "UNOHRD=%UNOHRD% "
set "DOSHRD=%DOSHRD% . "
set "TREHRD=%TREHRD% . "
goto :EOF
:DIGIT-SPACE
set "UNOHRD=%UNOHRD% "
set "DOSHRD=%DOSHRD% "
set "TREHRD=%TREHRD% "
goto :EOF
:TIEMPO
set HOUR=%TIME:~0,5%
:TIEMPO2
SET VAR=%HOUR:~0,1%
IF "%VAR%"==" " (CALL :DIGIT-SPACE) ELSE (CALL :DIGIT-%VAR%)
SET HOUR=%HOUR:~1%
IF "%HOUR%"=="" GOTO :EOF
GOTO :TIEMPO2
:FECHA
set /a DIA=(%DATE:~-10,2%*10)/10
set /a MES=(%DATE:~-7,2%*10)/10
set ANO=%DATE:~-4%
call :meses %MES% MFP
REM call Calendar /wday %DIA% %MES% %ANO% NDAY
GOTO :EOF
:MESES
if %1==1 set %2= Enero
if %1==2 set %2= Febrero
if %1==3 set %2= Marzo
if %1==4 set %2= Abril
if %1==5 set %2= Mayo
if %1==6 set %2= Junio
if %1==7 set %2= Julio
if %1==8 set %2= Agosto
if %1==9 set %2=Septiembre
if %1==10 set %2= Octubre
if %1==11 set %2=Noviembre
if %1==12 set %2=Diciembre
GOTO :EOF
Como veran esta muy completo y funcional, lo unico es la linea que deje comentada casi a lo ultimo, pues hace uso de un codigo que aun no publico, por lo tanto estara comentada para que no les ponga problemas, es la funcion que se encarga de obtener el dia de la semana segun la fecha....(lunes, martes, etc...).....mientras tanto.. :xD
Saludos.
MxPower, ahora tu reloj muestra el día de la semana.
(http://img236.imageshack.us/img236/456/relojpe6.png)
@echo off
::Version 2 modificada por Carlos
mode con cols=49
mode con lines=16
color 0a
goto HORA1
REM ---------------------------------------------------------------------------
:HORA1
cls
call:dia
call:getTime
title %hour%:%minute%
if %hour% lss 10 (set H1=0) else (set H1=%hour:~0,1%)
if %H1%==0 (goto UHOR-0)
if %H1%==1 (goto UHOR-1)
if %H1%==2 (goto UHOR-2)
:UHOR-0
set "UNOHRU= _ "
set "DOSHRU=³ ³"
set "TREHRU=³_³"
goto HORA2
:UHOR-1
set "UNOHRU= "
set "DOSHRU= ³ "
set "TREHRU= ³ "
goto HORA2
:UHOR-2
set "UNOHRU= _ "
set "DOSHRU= _³"
set "TREHRU=³_ "
goto HORA2
REM ---------------------------------------------------------------------------
:HORA2
call:getTime
if %hour% lss 10 (set H2=%hour%) else (set H2=%hour:~1,1%)
if %H2%==0 (goto DHOR-0)
if %H2%==1 (goto DHOR-1)
if %H2%==2 (goto DHOR-2)
if %H2%==3 (goto DHOR-3)
if %H2%==4 (goto DHOR-4)
if %H2%==5 (goto DHOR-5)
if %H2%==6 (goto DHOR-6)
if %H2%==7 (goto DHOR-7)
if %H2%==8 (goto DHOR-8)
if %H2%==9 (goto DHOR-9)
:DHOR-0
set "UNOHRD= _ "
set "DOSHRD=³ ³"
set "TREHRD=³_³"
goto MINU1
:DHOR-1
set "UNOHRD= "
set "DOSHRD= ³ "
set "TREHRD= ³ "
goto MINU1
:DHOR-2
set "UNOHRD= _ "
set "DOSHRD= _³"
set "TREHRD=³_ "
goto MINU1
:DHOR-3
set "UNOHRD= _ "
set "DOSHRD= _³"
set "TREHRD= _³"
goto MINU1
:DHOR-4
set "UNOHRD= "
set "DOSHRD=³_³"
set "TREHRD= ³"
goto MINU1
:DHOR-5
set "UNOHRD= _ "
set "DOSHRD=³_ "
set "TREHRD= _³"
goto MINU1
:DHOR-6
set "UNOHRD= _ "
set "DOSHRD=³_ "
set "TREHRD=³_³"
goto MINU1
:DHOR-7
set "UNOHRD= _ "
set "DOSHRD= ³"
set "TREHRD= ³"
goto MINU1
:DHOR-8
set "UNOHRD= _ "
set "DOSHRD=³_³"
set "TREHRD=³_³"
goto MINU1
:DHOR-9
set "UNOHRD= _ "
set "DOSHRD=³_³"
set "TREHRD= _³"
goto MINU1
REM ---------------------------------------------------------------------------
:MINU1
call:getTime
if %minute% lss 10 (set M1=0) else (set M1=%minute:~0,1%)
if %M1%==0 (goto UMIN-0)
if %M1%==1 (goto UMIN-1)
if %M1%==2 (goto UMIN-2)
if %M1%==3 (goto UMIN-3)
if %M1%==4 (goto UMIN-4)
if %M1%==5 (goto UMIN-5)
:UMIN-0
set "UNOMIU= _ "
set "DOSMIU=³ ³"
set "TREMIU=³_³"
goto MINU2
:UMIN-1
set "UNOMIU= "
set "DOSMIU= ³ "
set "TREMIU= ³ "
goto MINU2
:UMIN-2
set "UNOMIU= _ "
set "DOSMIU= _³"
set "TREMIU=³_ "
goto MINU2
:UMIN-3
set "UNOMIU= _ "
set "DOSMIU= _³"
set "TREMIU= _³"
goto MINU2
:UMIN-4
set "UNOMIU= "
set "DOSMIU=³_³"
set "TREMIU= ³"
goto MINU2
:UMIN-5
set "UNOMIU= _ "
set "DOSMIU=³_ "
set "TREMIU= _³"
goto MINU2
REM ---------------------------------------------------------------------------
:MINU2
call:getTime
if %minute% lss 10 (set M2=%minute%) else (set M2=%minute:~1,1%)
if %M2%==0 (goto DMIN-0)
if %M2%==1 (goto DMIN-1)
if %M2%==2 (goto DMIN-2)
if %M2%==3 (goto DMIN-3)
if %M2%==4 (goto DMIN-4)
if %M2%==5 (goto DMIN-5)
if %M2%==6 (goto DMIN-6)
if %M2%==7 (goto DMIN-7)
if %M2%==8 (goto DMIN-8)
if %M2%==9 (goto DMIN-9)
:DMIN-0
set "UNOMID= _ "
set "DOSMID=³ ³"
set "TREMID=³_³"
goto FECHA
:DMIN-1
set "UNOMID= "
set "DOSMID= ³ "
set "TREMID= ³ "
goto FECHA
:DMIN-2
set "UNOMID= _ "
set "DOSMID= _³"
set "TREMID=³_ "
goto FECHA
:DMIN-3
set "UNOMID= _ "
set "DOSMID= _³"
set "TREMID= _³"
goto FECHA
:DMIN-4
set "UNOMID= "
set "DOSMID=³_³"
set "TREMID= ³"
goto FECHA
:DMIN-5
set "UNOMID= _ "
set "DOSMID=³_ "
set "TREMID= _³"
goto FECHA
:DMIN-6
set "UNOMID= _ "
set "DOSMID=³_ "
set "TREMID=³_³"
goto FECHA
:DMIN-7
set "UNOMID= _ "
set "DOSMID= ³"
set "TREMID= ³"
goto FECHA
:DMIN-8
set "UNOMID= _ "
set "DOSMID=³_³"
set "TREMID=³_³"
goto FECHA
:DMIN-9
set "UNOMID= _ "
set "DOSMID=³_³"
set "TREMID= _³"
goto FECHA
REM ---------------------------------------------------------------------------
:FECHA
call:getDate
if %day% lss 10 (set DIA=0%day%) else (set DIA=%day%)
set MES=%month%
set ANO=%year%
goto DEFMES
:DEFMES
if %MES%==1 (set "MFP= Enero ")
if %MES%==2 (set "MFP= Febrero ")
if %MES%==3 (set "MFP= Marzo ")
if %MES%==4 (set "MFP= Abril ")
if %MES%==5 (set "MFP= Mayo ")
if %MES%==6 (set "MFP= Junio ")
if %MES%==7 (set "MFP= Julio ")
if %MES%==8 (set "MFP= Agosto ")
if %MES%==9 (set "MFP=Septiembre")
if %MES%==10 (set "MFP= Octubre ")
if %MES%==11 (set "MFP=Noviembre ")
if %MES%==12 (set "MFP=Diciembre ")
:RELOJ
echo.
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º²²²²²²²²²²±ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿±²²²²²²²²²²±º
echo º²MxPower²²±³ %UNOHRU% %UNOHRD% %UNOMIU% %UNOMID% ³±²²²²²²²²²²±º
echo º²²²²²²²²²²±³ %DOSHRU% %DOSHRD% . %DOSMIU% %DOSMID% ³±²²²²²²²²²²±º
echo º²²²²²²²²²²±³ %TREHRU% %TREHRD% . %TREMIU% %TREMID% ³±²²²²²²²²²²±º
echo º²²²²²²²²²²±³ ³±²²²²²²²²²²±º
echo º²²²²²²²²²²±ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ±²²²²²²²²²²±º
echo º²²²²²²²²²²±±±±±±±±±±±±±±±±±±±±±±±±²²²²²²²²²²±º
echo º²²²²²°ÚÄÄÄ¿±°ÚÄÄ¿±°ÚÄÄÄÄÄÄÄÄÄÄ¿±°ÚÄÄÄÄ¿±²²²²±º
echo º²²²²²°³%DIASEMANA:~0,3%³±°³%DIA%³±°³%MFP%³±°³%ANO%³±²²²²±º
echo º²²²²²°ÀÄÄÄÙ±°ÀÄÄÙ±°ÀÄÄÄÄÄÄÄÄÄÄÙ±°ÀÄÄÄÄÙ±²²²²±º
echo º±±±±²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²±±±±º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo ÀÄÄÄÄÄÙ ÀÄÄÄÄÄÙ
for /f "delims=:,-/ tokens=1-2,5-7" %%a in ("%time%-%date%") do set th1=%%a%%b%%c%%d%%e
:upd
for /f "delims=:,-/ tokens=1-2,5-7" %%a in ("%time%-%date%") do set th2=%%a%%b%%c%%d%%e
if not %th1%==%th2% (goto HORA1) else (goto upd)
::getDate-- crea 3 variables conteniendo el dia, el mes y el año : %%day%% %%month%% %%year%%
::Version: 1.1
::$author: Carlos
:getDate
if [%1]==[] (for /f "tokens=1-3 delims=-/" %%a in ("%date%") do (call :getDate %%a %%b %%c))
if not [%1]==[] (
set /a day=1%1-100
set /a month=1%2-100
set /a year=%3
)
goto:eof
::getTime-- crea 3 variables conteniendo la hora, el minuto y el segundo : %%hour%% %%minute%% %%second%%
::Version: 1.0
::$author: Carlos
:getTime
if [%1]==[] (for /f "tokens=1-3 delims=:," %%a in ("%time%") do (call :getTime %%a %%b %%c))
if not [%1]==[] (
set /a hour=%1
set /a minute=1%2-100
set /a second=1%3-100
)
goto:eof
:dia
::dia -- muestra el nombre del dia actual.
::Version: 1.6
::$author: Carlos
call:getDate
if [%year%] geq [1900] (if [%year%] leq [1999] (set marcador=3))
if [%year%] geq [2000] (if [%year%] leq [2099] (set marcador=2))
if [%year:~2,1%]==[0] (set /a year="%year:~3,3%") else (set /a year="%year:~2,3%")
set /a doomsday="((%year% / 12) + (%year% %% 12) + ((%year% %% 12) / 4)) %% 7 + %marcador%"
call :bisiesto %year%
if /i [%bisiesto%]==[false] (
set doomsday_1=17
set doomsday_2=14
) else (
set doomsday_1=18
set doomsday_2=15
)
set doomsday_3=14
set doomsday_4=18
set doomsday_5=16
set doomsday_6=13
set doomsday_7=18
set doomsday_8=15
set doomsday_9=12
set doomsday_10=17
set doomsday_11=14
set doomsday_12=12
call :set /a key=%%doomsday_%month%%%
set /a dia=%doomsday%
if %day% gtr %key% (
set /a diferencia="%day% - %key%"
set op=+
) else (
if %day% lss %key% (
set /a diferencia="%key% - %day%"
set op=-
) else (
set /a diferencia=1
set op=*)
)
set /a cont=0
:loopp
set /a cont +=1
set /a dia="%dia% %op% 1"
if %dia% equ 8 (set /a dia=1)
if %dia% equ 0 (set /a dia=7)
if %cont% neq %diferencia% (goto loopp)
if [%dia%]==[1] (set diaSemana=Lunes) else (
if [%dia%]==[2] (set diaSemana=Martes) else (
if [%dia%]==[3] (set diaSemana=Miercoles) else (
if [%dia%]==[4] (set diaSemana=Jueves) else (
if [%dia%]==[5] (set diaSemana=Viernes) else (
if [%dia%]==[6] (set diaSemana=Sabado) else (
if [%dia%]==[7] (set diaSemana=Domingo) ))))))
goto :eof
:set
set %*
goto :eof
:bisiesto
::$author: Carlos
set bisiesto=false
set /a mod1="%1 %% 4"
set /a mod2="%1 %% 100"
set /a mod3="%1 %% 400"
if [%mod1%]==[0] (if not [%mod2%]==[0] (set bisiesto=true))
if [%mod3%]==[0] (set bisiesto=true)
goto :eof