:: 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
| attrib | … | ファイルの属性を表示する |
| dir /b | … | ディレクトリとファイルの名前のみを表示する |
Copyright (C) 2005-2007 Noto Watabe. All rights reserved.
e-mail:wmh@always-pg.com