win系统DOS批处理命令:每日根据定时计划,弹出相应的提醒
1 @echo off 2 setlocal enabledelayedexpansion 3 ::设置数据源 4 ::set DATASET=D:\soft\xinyu\xinyu.txt 5 6 ::获取系统时间的星期值 7 ::set day=%date:~12,14% 8 ::set day=%date:~8,2% 9 set pre=%date:~8,1% 10 if "%pre%" =="0" (set /a day=%date:~9,1%) else set /a day=%date:~8,2% 11 12 ::进行求余数 13 ::echo %day% 14 set /a sep=day%%14 15 ::echo %sep% 16 ::pause 17 18 if not "%sep%"=="0" (set /a p = %sep%-1) else set /a p = 13 19 ::echo %p% 20 ::echo. 21 22 echo. 23 echo 【日期】%date:~0,14% 24 if "%p%"=="0" ( 25 for /f "tokens=1-3 delims=$" %%i in (D:\soft\xinyu\xinyu.txt) do ( 26 ::echo %%i 27 set BL1=%%i 28 set BL2=%%j 29 set BL3=%%k 30 ::if %day% gtr 14 (set /a BL2=%%j) else (set /a BL2=%%k 31 echo. 32 echo 【作者】!BL1! 33 echo. 34 echo 【心语一】!BL2! 35 echo. 36 echo 【心语二】!BL3! 37 echo. 38 pause 39 exit 40 ) 41 ) else ( 42 for /f "skip=%p% tokens=1-3 delims=$" %%i in (D:\soft\xinyu\xinyu.txt) do ( 43 ::echo %%i 44 set BL1=%%i 45 set BL2=%%j 46 set BL3=%%k 47 ::if %day% gtr 14 (set /a BL2=%%j) else (set /a BL2=%%k 48 echo. 49 echo 【作者】!BL1! 50 echo. 51 echo 【心语一】!BL2! 52 echo. 53 echo 【心语二】!BL3! 54 echo. 55 pause 56 exit 57 ) 58 ) 59 pause 60 exit