DOS コマンドを目的別に調べることができる辞典

ホーム > DOS コマンド逆引き辞典 > コピー > アーカイブ属性の付いたファイルのみをコピーする

DOS コマンド逆引き辞典

:: reverse dictionary ::

コピー

アーカイブ属性の付いたファイルのみをコピーする

アーカイブ属性の付いたファイルのみをコピーするには、xcopy コマンドに次の3つを指定して実行します。

≪ディレクトリ構造(サンプル)≫

D:ディレクトリ  F:ファイル

                        [属性]
D C:\MyDir
├ F sample01.txt       A
├ F sample02.txt       A
├ F sample03.txt
├ D SubDir
│ └ F sample04.txt    A
└ D SubDir2
   └ F sample05.txt
C:\MyDir>xcopy sample??.txt SubDir /a
C:sample01.txt
C:sample02.txt
2 個のファイルをコピーしました

C:\MyDir>dir SubDir\sample??.txt /b
sample01.txt
sample02.txt
sample04.txt

C:\MyDir>xcopy sample??.txt SubDir2 /m
C:sample01.txt
C:sample02.txt
2 個のファイルをコピーしました

C:\MyDir>dir SubDir2\sample??.txt /b
sample01.txt
sample02.txt
sample05.txt

▼ コマンド

xcopy 送り側 [受け側] [/a] [/m]

xcopy コマンドに /a スイッチまたは /m スイッチを付けると、アーカイブ属性の付いたファイルのみをコピーします。

/a スイッチは、送り側のアーカイブ属性を付けたままにします。
/m スイッチは、送り側のアーカイブ属性をはずします。

C:\MyDir>xcopy SubDir\sample04.txt /a
SubDir\sample04.txt
1 個のファイルをコピーしました

C:\MyDir>attrib SubDir\sample04.txt
A          C:\MyDir\SubDir\sample04.txt

C:\MyDir>xcopy SubDir\sample04.txt SubDir2 /m
SubDir\sample04.txt
1 個のファイルをコピーしました

C:\MyDir>attrib SubDir\sample04.txt
           C:\MyDir\SubDir\sample04.txt

▼ 参照

注目キーワード ベスト5

  1. セキュリティ
  2. ホスティング
  3. レンタルサーバ
  4. ファイル復旧
  5. ハードディスク修復

コピー - copy -


ホーム > DOS コマンド逆引き辞典 > コピー > アーカイブ属性の付いたファイルのみをコピーする

Copyright (C) 2005-2007 Noto Watabe. All rights reserved.
e-mail:wmh@always-pg.com