Finding day of week in batch file? (Windows Server 2008)

batchdatems-doswindows-server-2008

I have a process I run from a batch file, and i only want to run it on a certain day of the week.
Is it possible to get the day of week?

All the example I found, somehow rely on "date /t" to return "Friday, 12/11/2009", however, in my machine, "date /t" returns "12/11/2009". No weekday there.

I've already checked the "regional settings" for my machine, and the long date format does include the weekday. The short date format doesn't, but i'd really rather not change that, since it'll affect a bunch of stuff I do.

Best Answer

I'm a little late to this party, but this will give you the day of week:

wmic path win32_localtime get dayofweek

Use a batch for loop to obtain the output, and you have a testable condition for the day of the week.

Rob