ATTRIB

Computer command in various operating systems


title: "ATTRIB" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["external-dos-commands", "msx-dos-commands", "os/2-commands", "reactos-commands", "windows-commands"] description: "Computer command in various operating systems" topic_path: "technology/operating-systems" source: "https://en.wikipedia.org/wiki/ATTRIB" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0

::summary Computer command in various operating systems ::

::data[format=table title="Infobox software"]

FieldValue
nameattrib
screenshotReactOS-0.4.13 attrib command 667x434.png
captionThe ReactOS attrib command
developerIntel, IBM, Microsoft, DR, Datalight, Novell, Phil Brutsche, ReactOS Contributors
released(DOS version)
operating systemISIS-II, PC DOS, MS-DOS, MSX-DOS, SISNE plus, OS/2, eComStation, ArcaOS, Windows, DR DOS, ROM-DOS, FreeDOS, ReactOS, SymbOS
platformCross-platform
genreCommand
licenseFreeDOS, ReactOS: GPLv2
::

| name = attrib | logo = | screenshot = ReactOS-0.4.13 attrib command 667x434.png | screenshot size = | caption = The ReactOS attrib command | developer = Intel, IBM, Microsoft, DR, Datalight, Novell, Phil Brutsche, ReactOS Contributors | released = (DOS version) | latest release version = | latest release date = | operating system = ISIS-II, PC DOS, MS-DOS, MSX-DOS, SISNE plus, OS/2, eComStation, ArcaOS, Windows, DR DOS, ROM-DOS, FreeDOS, ReactOS, SymbOS | platform = Cross-platform | genre = Command | license = FreeDOS, ReactOS: GPLv2 | website = In computing, ATTRIB is a command in Intel ISIS-II, DOS, IBM OS/2, Microsoft Windows and ReactOS that allows the user to change various characteristics, or "attributes" of a computer file or directory. The command is also available in the EFI shell.{{cite web | url = http://software.intel.com/en-us/articles/efi-shells-and-scripting/ | title = EFI Shells and Scripting | publisher = Intel | access-date = 2013-09-25

History

Several operating systems provided a set of modifiable file characteristics that could be accessed and changed through a low-level system call. For example, as of release MS-DOS 4.0, the first six bits of the file attribute byte indicated whether or not a file was read-only (as opposed to writeable), hidden, a system file, a volume label, a subdirectory, or if the file had been "archived" (with the bit being set if the file had changed since the last use of the [BACKUP](list-of-dos-commands-backup-and-restore) command). However, initial releases of the operating system did not provide user-level method for reading or changing these values.

The initial version of the ATTRIB command for DOS was first included in version 3.0 of PC DOS, with functionality limited to changing the read-only attribute. Subsequent versions allowed the read-only, hidden, system and archive bits to be set. MS-DOS version 3.3 added the capability of recursive searching through subdirectories to display attributes of specified files.

Digital Research DR DOS 6.0 and Datalight ROM-DOS also include an implementation of the command.

The FreeDOS version was developed by Phil Brutsche and is licensed under the GPLv2.

Uses

Setting the read-only bit of a file provided only partial protection against inadvertent deletion: while commands such as [del](del-command) and [erase](del-command) would respect the attribute, other commands such as [DELTREE](deltree) did not. Changing the system attribute was not possible in early versions of Windows, thus requiring use of ATTRIB. Similarly, a system crash in early versions of Windows could lead to a situation where a temporary file had the read-only bit set and was additionally (and irrevocably) locked by the Windows OS; in this instance, booting into DOS (thus avoiding the Windows lock) and unsetting the read-only attribute with ATTRIB was the recommended way of deleting the file. Manipulating the archive bit allowed users to control which files were backed up using the BACKUP command.

References

References

  1. [http://bitsavers.org/pdf/intel/ISIS_II/9800306-06_ISIS-II_Users_Guide_May81.pdf ISIS II Users Guide]
  2. "JaTomes Help - OS/2 Commands".
  3. [https://technet.microsoft.com/en-us/library/bb490868 Microsoft TechNet Attrib article]
  4. [https://github.com/reactos/reactos/blob/master/base/applications/cmdutils/attrib/attrib.c reactos/attrib.c at master · reactos/reactos · GitHub]
  5. "DR DOS 6.0 User Guide Optimisation and Configuration Tips".
  6. "Datalight ROM-DOS User's Guide".
  7. (2003-07-01). "FreeDOS 1.2 Updates Package - attrib (FreeDOS Base)". Ibiblio.org.
  8. Petzold, Charles. (June 10, 1986). "Changing DOS File Attributes". PC Magazine.
  9. (1999). "Windows 98 in a Nutshell: A Desktop Quick Reference". O'Reilly.
  10. (2003). "A+ Exam Cram 2: Windows 2000 Directory Services Infrastructure". Que.
  11. "DOS Attrib". PC Magazine.
  12. (July 1988). "IBM Disk Operating System Version 4.00 Technical Reference".
  13. "Using ATTRIB, CHKDSK, or DIR Command to Locate Files". Microsoft.

::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::

external-dos-commandsmsx-dos-commandsos/2-commandsreactos-commandswindows-commands