-1

我在这个时候得到 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
4

1 回答 1

1

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

删除该/f选项,它应该可以工作。

于 2012-11-27T01:45:58.620 回答