Difference between revisions of "Windows File Attributes"

From Free Knowledge Base- The DUCK Project: information for everyone
Jump to: navigation, search
(Created page with "The operating systems (DOS, Win95/98, WinNT/2000/XP) maintain a type of meta data known as archive bits associated with every file and directories. In earlier MS-DOS and Micro...")
(No difference)

Revision as of 06:40, 5 March 2015

The operating systems (DOS, Win95/98, WinNT/2000/XP) maintain a type of meta data known as archive bits associated with every file and directories. In earlier MS-DOS and Microsoft Windows, there were four attributes: archive, hidden, read-only and system. Windows has added a new ones.

A file attribute can exist as only one of two states, set or cleared. Attributes can be in files, directories, volumes and certain system objects. They are used by the operating system and software applications to define file system behavior.

The Primary MS-DOS / Windows File Attributes:

  • archive bit - (shows that the file has not been archived yet)
  • read-only bit - (write-protect the file)
  • directory bit - (distinguishes a directory from a file)
  • hidden bit - (hides from an ordinary directory listing)
  • system bit - (denotes a system file whatever that means)

As new versions of Windows came out, Microsoft has added to the inventory of available attributes on the NTFS file system.

  • compressed - (when set, Windows compresses the hosting file upon storage. For more information, see NTFS § File compression.)
  • encrypted - (when set, Windows encrypts the hosting file upon storage to prevent unauthorized access.)
  • indexed - (when set, Indexing Service or Windows Search do not include the hosting file in their indexing operation.)

Windows 95/98 provide a system utility program, ATTRIB.EXE which is usually stored in the C:\Windows\command\ directory.

ATTRIB command syntax:

   ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] filespec [/S]
      +   Sets an attribute.
      -   Clears an attribute.
      R   Read-only file attribute.
      A   Archive file attribute.
      S   System file attribute.
      H   Hidden file attribute.
      /S  Processes files in all directories in the specified path.

For example if you want to clear the Archive attribute bit of all the files in a directory, execute the following command line.

ATTRIB  -A c:\mydir\*

archive bit

read-only bit

hidden bit

system bit