将下面代码保存BAT文件即可执行:
set filename=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%echo %filename%