Soldato
I'm trying to batchify *sic* a CMD line to parse the Day of Week from the DATE variable. From a command line it works perfectly. But from a batch file it causes an 'unexpected' result. Is there something I need to define first to get it to operate properly?
The command 'ECHO %DOW%' gives the desired result, so I know the variable is set properly.
But from a batch file, it returns:
It looks like it's ignoring the %1 I'm trying to set. Any ideas what's going wrong? I've tried it with various other variable other than %1 as well.
Code:
for /f "tokens=1" %1 in ('date /t') do set DOW=%1
But from a batch file, it returns:
Code:
in was unexpected at this time.
C:\>for /f "tokens=1" in ('date /t') do set DOW=