批次檔內容如下
SET "qdate=%date:~0,4%%date:~5,2%%date:~8,2%"
xcopy "%qdate%.log" g:\test /q
XCOPY F:\*%DATE:~0,4%-%DATE:~5,2%-%DATE:~8,2%* Y:\
forfiles指令可試試,功能滿多的,例如你的需求為
forefiles /p c:\source /m *.txt /s /d +0 /c "cmd /c copy @path d:/backup"