コマンドプロンプトコマンドメモ



日付のフォルダ作成

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

最終更新:2011年10月31日 17:08