Here’s a simple script that will give you today’s date in numeric format in three variables. This has a bunch of uses, but I use it when I need to audit when a script was last run. The script has been tested under Windows XP x86 and Windows 7 x64. You may need to swap the varMM and varDD variables if you are using a version of Windows other than the U.S. version.
:: Formatting the date into a YYYYMMDD format and setting it to the variable, varTodaysDate