The code will work on XP Pro and higher as they all have WMIC.EXE
For XP Home you'll need different code.
:: date time from Richie Lawrence
:: GetDate.cmd ::::::::::::::::::::::::::::::::::::::::::::::::::::::
@ECho off & Setlocal
Call :GetDate yy mm dd
Echo Today in ISO format = %yy%-%mm%-%dd%
Goto :Eof
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:GetDate yy mm dd
::
:: By: Ritchie Lawrence, 2002-06-15. Version 1.0
::
:: Func: Loads local system date components into args 1 to 3.
:: For NT4/2000/XP/2003.
::
:: Args: %1 var to receive year, 4 digits (by ref)
:: %2 var to receive month, 2 digits, 01 to 12 (by ref)
:: %3 Var to receive day of month, 2 digits, 01 to 31 (by ref)
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
setlocal ENABLEEXTENSIONS
set t=2&if "%date%z" LSS "A" set t=1
for /f "skip=1 tokens=2-4 delims=(-)" %%a in ('echo/^|date') do (
for /f "tokens=%t%-4 delims=.-/ " %%d in ('date/t') do (
set %%a=%%d&set %%b=%%e&set %%c=%%f))
:: This line for an English locale
endlocal&set %1=%yy%&set %2=%mm%&set %3=%dd%&goto :EOF
:: replace previous line with the following line for a German locale
endlocal&set %1=%JJ%&set %2=%MM%&set %3=%TT%&goto :EOF
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
--
foxi