Find Files by Attribute-Command prompt

File attributes describe files in specific ways. For example, the read-only attribute defines a file that can’t be written—only read. Directories use a special directory attribute that sets them apart from files. The Dir / AAttribute Filename command, where Attribute is the attribute you want to search for, helps you locate specific kinds of files.
Now that you have some idea of how to find files using an attribute, it’s time to look at the available attributes. The following list describes each of the standard attributes:

·        /AA: Locates files that are ready for archiving.
·        /AD: Locates directory entries.
·        /AH: Locates hidden files (these are sometimes visible within
          Windows Explorer without any special setup).
·        /AI: Displays files that aren’t indexed for use in Windows Search.
·        /AL: Displays file entries that include reparse points. A reparse point is special data associated with the file that defines it in a special way using custom data that’s managed by a filter (such as the properties set on a Word document that you see on the Details tab of the file’s Properties dialog box). You can read about reparse points at http://msdn.microsoft.com/library/aa365503.aspx.
·        /AR: Locates read-only files.
·        /AS: Locates system files.
·        /A–Attribute: A prefix used to negate a standard attribute. For example, if you want to find all entries except for directories, you type Dir /A–D and press Enter.


The attributes are important for another reason. The Dir command won’t display hidden files unless you add the /AH switch. Consequently, you might not even see some files without using an attribute switch. You can combine switches to obtain specific effects. For example, the hidden and system switches are commonly used together for operating system files. If you want to find just the operating system files on a hard drive, you can type Dir *.* /AH /AS /S and press Enter.

No comments:

Post a Comment