cd C:\test
rem 時間を整形(0時~9時のとき対応)
set hour=%time:~0,2%
IF "%hour:~0,1%" == " " (
set hour=0%hour:~1,1%
)
rem 日付入りの新しいフォルダ名
set newFolder=backup_%date:~0,4%%date:~5,2%%date:~8,2%%hour%%time:~3,2%
md %newFolder%
rem フォルダごとコピー
xcopy /s /i C:\test\sample %newFolder%\sample_copy
type a.txt b.txt > result.log type *.txt > result.log