Okay. Figured I’d include this as well, because I don’t ever want to forget this part. Here’s how to set date and time variables in a DOS batch script.
for /f "tokens=1-7 delims=.:,/ " %%a in ("%date% %time%") do (
set day=%%c&set mon=%%b&set year=%%d&set hr=%%e&set min=%%f&set sec=%%g
echo %datex% %timex%
Obviously, we you don’t need all the echo statements, but it helps to define what’s what. This was tested on XP.