@echo offset /a tm1=%time:~0,2%*1if %tm1% LSS 10 set tm1=0%tm1%echo %date:~0,4%%date:~5,2%%date:~8,2%%tm1%%tm2%%tm3%%time:~3,2%%time:~6,2%pause 结果:20120710191105
以上内容根据网络整理而得,方便学习查阅