set YYYYmmdd=%date:~0,4%.%date:~5,2%.%date:~8,2%
set hhmiss=%time:~0,2%.%time:~3,2%.%time:~6,2%
set "filename=XXX.%YYYYmmdd%.%hhmiss%.dll"
ren XXX.dll "%filename%"
move "%filename%" backup
来源:https://blog.csdn.net/a731062834/article/details/99547316