CODE: [Copy to clipboard]
@echo off&setlocal enabledelayedexpansion
title 2012奥运倒计时 made by batman
mode con cols=60 lines=10&color 1c
if "%date:~,4%%date:~5,2%%date:~8,2%%time:~,2%%time:~3,2%%time:~6,2%" gtr "20120727121200" (
echo 倒计时时间已过。。。&ping /n 3 127.1>nul&goto :eof
)
for /l %%a in (1,1,60) do set "k=!k! "
echo.&echo.&echo 同一个世界 同一种期盼&echo.&echo.
set /a num=31,_2012=7
for %%a in (1 3 5 7 8 10 12 4 6 9 11) do (
if %%a equ 4 set /a num-=1
set /a _%%a=num
)
:again
set /a y=%date:~,4%,mo=1%date:~5,2%%%100,d=1%date:~8,2%%%100,h=%time:~,2%,m=1%time:~3,2%%%100,s=1%time:~6,2%%%100,ms=1%time:~9,2%%%100,_%y%=mo,num_d=-5
for /l %%a in (%y% 1 2012) do (
if %%a equ 2012 (set /a _2=29) else set /a _2=28
if %y% equ 2012 (
if %mo% equ 7 (
set /a num_d+=31-d
) else (
for /l %%b in (%mo% 1 7) do set /a num_d+=_%mo%
set /a num_d-=d
)
) else (
if %%a neq 2012 set /a num_d+=365
for %%b in (%y% 2012) do (
if %%b equ %%a (
if %%b equ %y% (set "+=-"&set /a num_d+=_%mo%-d) else set "+=+"
for /l %%c in (1,1,!_%%b!) do set /a num_d!+!=_%%c
)
)
)
)
set /a num_h=35-h,num_m=71-m,num_s=59-s,num_ms=100-ms
for %%a in (ms-100-s s-60-m m-60-h h-24-d) do (
for /f "tokens=1-3 delims=-" %%a in ("%%a") do if !num_%%a! geq %%b set /a num_%%a-=%%b,num_%%c+=1
)
if %num_ms% lss 10 set "num_ms=0%num_ms%"
set /p=%k% 离第三十届伦敦奥运会开幕还有%num_d%天%num_h%小时%num_m%分%num_s%秒%num_ms%毫秒<NUL
for /l %%a in (1,1,600) do echo>nul
goto again
[CODE: [Copy to clipboard]
@echo off
setlocal enabledelayedexpansion
mode con cols=25 lines=5
title %date%
set "cut="
set "str=xxxxxxxx"
:a
set t=%time:~0,8%
call :next
ping -n 3 127.1>nul
set "t= "
call :next
goto :a
:next
for /l %%a in (0,1,7) do (set num%%a=%%a)
set /a aa=8
:aa
set /a rand=%random%%%aa,aa-=1
set /a x=num%rand%,xb=x+1
set str=!str:~0,%x%!!t:~%x%,1!!str:~%xb%!
set num%rand%=!num%aa%!
ping -n 1 127.1>nul
cls
echo, %str%
if %aa% gtr 0 (goto :aa)
goto :eof