Microsoft Windows XP - Attrib

Embed Size (px)

Citation preview

  • 8/12/2019 Microsoft Windows XP - Attrib

    1/3

    30/1/2014 Microsoft Windows XP - Attrib

    http://www.microsoft.com/resources/documentation/windows/xp/al l/proddocs/en-us/attrib.mspx?mfr=true 1/3

    Attrib

    Displays, sets, or removes the read-only, archive, system, and hidden attributes assigned to files or

    directories. Used without parameters, attribdisplays attributes of all files in the current directory.

    Syntax

    attrib[{+r|-r}] [{+a|-a}] [{+s|-s}] [{+h|-h}] [[Drive:][Path] FileName] [/s[/d]]

    Top of page

    Parameters

    +r : Sets the read-only file attribute.

    -r : Clears the read-only file attribute.

    +a : Sets the archive file attribute.

    -a : Clears the archive file attribute.

    +s : Sets the system file attribute.

    -s : Clears the system file attribute.

    +h : Sets the hidden file attribute.

    -h : Clears the hidden file attribute.

    [Drive:][Path] FileName: Specifies the location and name of the directory, file, or set of files for which you

    want to display or change attributes. You can use wildcard characters (that is, ? and *) in the FileName

    parameter to display or change the attributes for a group of files.

    /s : Applies attriband any command-line options to matching files in the current directory and all of its

    subdirectories.

    /d : Applies attriband any command-line options to directories.

    /? : Displays help at the command prompt.

    Top of page

    Remarks

    Working with groups of files

    You can use wildcard characters (that is, ? and *) with the FileNameparameter to display or change the

    attributes for a group of files. If a file has the system or hidden attribute set, you must clear these

    attributes before you can change any other attributes for that file.

    Using the archive attribute

    The archive attribute (that is, +a) marks files that have changed since the last time they were backed up.

    The xcopy command uses archive attributes. For more information about archive attributes and xcopy,

    see Related Topics.

    The attribcommand, with different parameters, is available from the Recovery Console.

    Top of page

    Examples

    To display the attributes of a file named News86 located on the current drive, type:

    attrib news86

    To assign the read-only attribute to the file named Report.txt, type:

    attrib +r report.txt

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Microsoft Windows XP - Attrib

    2/3

    30/1/2014 Microsoft Windows XP - Attrib

    http://www.microsoft.com/resources/documentation/windows/xp/al l/proddocs/en-us/attrib.mspx?mfr=true 2/3

    To remove the read-only attribute from files in the \Public\Jones directory on a disk in drive B and from files

    in any subdirectories of \Public\Jones, type:

    attrib -r b:\public\jones\*.* /s

    Consider a scenario where you want to give an associate a disk containing all files in the default directory on

    a disk in drive A, except files with the .bak extension. Because you can use xcopy to copy only those files

    marked with the archive attribute, you need to set the archive attribute for those files you want to copy. First,

    you need to set the archive attribute for all files on drive A. Second, you need to clear the archive attribute

    for those files with the .bak extension. For example, type:

    attrib +a a:*.* attrib -a a:*.bak

    Next, use xcopyto copy the files from the disk in drive A to the disk in drive B. The /acommand-line option

    in the following command causes xcopy to copy only those files marked with the archive attribute. For

    example, type:

    xcopy a: b: /a

    If you want xcopy to clear each file's archiveattribute after it copies the files, use the /mcommand-line

    option instead of /a. For example, type:

    xcopy a: b: /m

    Top of page

    Formatting legend

    Format Meaning

    Italic Information that the user must supply

    Bold Elements that the user must type exactly as

    shown

    Ellipsis (...) Parameter that can be repeated several times in

    a command line

    Between brackets ([]) Optional items

    Between braces ({}); choices separated by pipe (|).

    Example: {even|odd}

    Set of choices from which the user must choose

    only one

    Courier font Code or program output

    Command-line reference A-Z

    Dir

    Copy

    Xcopy

    Using wildcard characters

    Top of page

    http://-/?-http://-/?-http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/find_c_search_wildcard.mspxhttp://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspxhttp://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/copy.mspxhttp://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/dir.mspxhttp://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspxhttp://-/?-http://-/?-
  • 8/12/2019 Microsoft Windows XP - Attrib

    3/3

    Printer Friendly Version Send This Content Add To Favorites

    How would you rate the usefulness of this content ?

    1 2 3 4 5

    Poor Outstanding

    Tell us why you rated the content this way. (optional)

    Manage Your Profile | Legal | Contact Us

    2014 Microsoft Corporation. All rights reserved. Contact Us | Terms of Use | Trademarks | Privacy Statement

    http://go.microsoft.com/?linkid=4412894http://go.microsoft.com/?linkid=4412893http://go.microsoft.com/?linkid=4412892http://support.microsoft.com/contactus/?ws=mscomhttp://register.microsoft.com/contactus30/contactus.asp?domain=technethttp://www.microsoft.com/isapi/gomscom.asp?target=/legal/http://go.microsoft.com/?linkid=317027http://__dopostback%28%27contentratingcontrol%24lnkbtnaddtofavorite%27%2C%27%27%29/http://__dopostback%28%27contentratingcontrol%24_ctl6%27%2C%27%27%29/http://__dopostback%28%27contentratingcontrol%24_ctl4%27%2C%27%27%29/