Date Mon = = Sun此时出乎意料

时间:2012-11-26 21:03:20

标签: time batch-file

我得到了Mon == Sun此时出乎意料。我不知道我做错了什么。我所有的if语句都很好看,所以如果有人看到了什么,请告诉我。

set day7=%DATE:~0,3%
set month12=%DATE:~4,2% 
set day365=%DATE:~7,2%
set year1=%DATE:~10,4%

if /f %day7%==Sun set day7=Sunday
if /f %day7%==Mon set day7=Monday
if /f %day7%==Tue set day7=Tuesday
if /f %day7%==Wed set day7=Wednesday
if /f %day7%==Thu set day7=Thursday
if /f %day7%==Fri set day7=Friday
if /f %day7%==Sat set day7=Saturday

for /f "eol=; tokens=%month12% delims=," %%i in ("January,February,March,April,May,June,July,August,September,October,November,December") do set month12=%%i 

echo Today is %day7% %month12% %day365% %year1%
GOTO redo

1 个答案:

答案 0 :(得分:1)

IF命令没有/f选项,因此语法错误。

删除/f选项,它应该有效。