CMD命令输出文件名中插入当前系统时间
by
admin on 2014-09-05 14:10:49 in
,
@echo off
set mydd=%date:~8,2%
set myyy=%date:~0,4%
set mymm=%date:~5,2%
echo %myyy% %mymm% %mydd%
dir>c:\test_%myyy%%mymm%%mydd%.txt
pause
上面的语句精简为一句话
dir>c:\test_%date:~0,4%%date:~5,2%%date:~8,2%.txt
评论