1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ディレクトリのコピー(配下すべて、ファイルは0バイト)

Last updated at Posted at 2015-10-03

どんな時に便利か

ファイルの中身は関係ない、ファイル抽出のbatのテストをしたい。
ディレクトリをコピッてテストしたいが、ファイルの容量が大きいのでコピーしたくない。
そんなときにご利用ください。

嗚呼、robocopy

以下を実行

robocopy <source_dir> <dest_dir> /E /CREATE

/Eスイッチはサブディレクトリ(ファイルを有しないディレクトリを含む)
ファイルを有しないディレクトリはコピーしない場合は /Sスイッチに
/CREATE オプションは0バイトのファイルを生成するオプション
robocopyは中断時の挙動も含め多くのオプションがあり、非常に便利です。

備忘録

サブディレクトリ含む
特定の名前のファイル
※一部のディレクトリは除く
をコピーするには

robocopy <source_dir> <dest_dir> FILE_NAME.EXT /S /XD EX1 EX2 
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?