Discussion forum for all Windows batch related topics.
4 posts • Page 1 of 1
I have a logon script that maps the user to drives after they logon. Is It possible to show a line within this to say Happy Birthday on the day it is their birthday? Subsequently I can then edit it for other days like Christmas, Easter or other days of interest?
No problem for holidays or anniversaries at a fixed date.
But for days like Easter? I never tried to write a transcription of Gauss' Easter algorithm in pure Batch, but you may give it a go ... The formula is large but probably simple enough to bring it into a subroutine.
Code: Select all
@echo off &setlocal for /f %%i in ('WMIC OS Get LocalDateTime /value') do for /f %%j in ("%%i") do set "%%j" if "%LocalDateTime:~4,4%"=="0928" echo Happy Today! if "%LocalDateTime:~4,4%"=="1225" echo Merry Christmas! pause