可以用date和find来寻找当天是否3月18日。在纯DOS或Win9x下:
@echo off
kpush 13
date|find "3-18" >nul
if errorlevel 1 goto end
echo Today is March 18, updating...
copy xxxx d:\computer >nul
echo Update completed.
:end
注:kpush是MSDOS 7.1启动盘里的模拟键盘输入的小程序。
在Win2000/XP下写法略有不同:
@echo off
date /t|find "3-18" >nul
if errorlevel 1 goto end
echo Today is March 18, updating...
copy xxxx d:\computer >nul
echo Update completed.
:end