ファイルまたはディレクトリに割り当てられた属性を表示、設定、または削除します。 If used without parameters, attrib displays attributes of all files in the current directory.
Syntax
attrib [{+|-}r] [{+|-}a] [{+|-}s] [{+|-}h] [{+|-}o] [{+|-}i] [{+|-}x] [{+|-}p] [{+|-}u] [{+|-}b] [<drive>:][<path>][<filename>] [/s [/d] [/l]]
Parameters
Parameter | Description |
---|---|
{+\|-}r |
読み取り専用ファイル属性を設定 (+) またはクリア (-) します。 |
{+\|-}a |
アーカイブ ファイル属性を設定 (+) またはクリア (-) します。 この属性セットは、前回のバックアップ以降に変更されたファイルをマークします。 The xcopy command uses archive attributes. |
{+\|-}s |
システム ファイル属性を (+) またはクリア (-) します。 ファイルでこの属性セットを使用する場合は、ファイルの他の属性を変更する前に、属性をクリアする必要があります。 |
{+\|-}h |
非表示ファイル属性を設定 (+) またはクリア (-) します。 ファイルでこの属性セットを使用する場合は、ファイルの他の属性を変更する前に、属性をクリアする必要があります。 |
{+\|-}o |
オフライン ファイル属性を設定 (+) またはクリア (-) します。 |
{+\|-}i |
Not Content Indexed ファイル属性を (+) またはクリア (-) します。 |
{+\|-}x |
スクラブ ファイル属性を (+) またはクリア (-) します。 |
{+\|-}p |
固定ファイル属性を設定 (+) またはクリア (-) します。 |
{+\|-}u |
固定されていないファイル属性を設定 (+) またはクリア (-) します。 |
{+\|-}b |
SMR BLOB ファイル属性を (+) またはクリア (-) します。 |
[<drive>:][<path>][<filename>] |
属性を表示または変更するファイルのディレクトリ、ファイル、またはグループの場所と名前を指定します。 You can use the ? and * wildcard characters in the filename parameter to display or change the attributes for a group of files. |
/s | Applies attrib and any command-line options to matching files in the current directory and all of its subdirectories. |
/d | Applies attrib and any command-line options to directories. |
/l | Applies attrib and any command-line options to the Symbolic Link, rather than the target of the Symbolic Link. |
/? | コマンド プロンプトにヘルプを表示します。 |
Examples
現在のディレクトリにある News86 という名前のファイルの属性を表示するには、次のように入力します。
attrib news86
report.txtという名前のファイルに読み取り専用属性を割り当てるには、次のように入力します。
attrib +r report.txt
パブリック ディレクトリ内のファイルとドライブ b: のディスク上のサブディレクトリから読み取り専用属性を削除するには、次のように入力します。
attrib -r b:\public\*.* /s
ドライブ a: 上のすべてのファイルのアーカイブ属性を設定し、.bak拡張子を持つファイルのアーカイブ属性をクリアするには、次のように入力します。
attrib +a a:*.* & attrib -a a:*.bak