Jump to content

ATTRIB

From Alfawiki
ATTRIB
Company typeCommand-line utility
IndustryComputing / Operating systems
FoundedIntroduced in PC DOS 3.0
ProductsFile attribute modification utility

In the realm of computing, the ATTRIB command is incorporated into various operating systems such as Intel's ISIS-II, DOS, IBM OS/2, Microsoft Windows, and ReactOS. This utility enables users to alter the attributes assigned to files or directories. Additionally, support for this command exists within the Unified Extensible Firmware Interface (EFI) shell environment.

History

File attributes that could be adjusted were initially managed through low-level system calls in early operating systems. By the time MS-DOS 4.0 was released, six attribute flags were used to identify whether a file was marked as read-only, hidden, a system file, volume label, subdirectory, or archived (indicating modification since the last backup). However, these early systems did not provide end-users with tools to modify these attributes directly.

The ATTRIB command made its debut in PC DOS 3.0, originally offering only basic functionality to toggle the read-only attribute. Subsequent updates expanded its scope to include manipulation of the read-only, hidden, system, and archive flags. With MS-DOS 3.3, recursive directory searching was introduced for displaying attributes across nested folders.

Variants of this command were also implemented in other operating systems such as Digital Research's DR DOS 6.0 and Datalight's ROM-DOS. The FreeDOS iteration was created by Phil Brutsche and is distributed under the GPLv2 license.

Uses

Applying the read-only attribute to a file provided a modest safeguard against unintended deletion: while commands like del and erase honored this setting, others including DELTREE ignored it. Early versions of Windows did not permit direct modification of the system attribute without using ATTRIB. Furthermore, system failures sometimes caused temporary files to become locked with the read-only attribute enabled; resolving this required booting into DOS and employing ATTRIB to clear the flag before deletion was possible. Control over the archive attribute allowed users to specify which files should be included in backup operations executed via the BACKUP command.

See also

Further reading

  • Jim Cooper, Special Edition Using MS-DOS 6.22, Third Edition, Que Publishing, 2001, ISBN 978-0789725738
  • Peter Dyson, Mastering OS/2 Warp, Sybex, 1995, ISBN 978-0782116632
  • John Paul Mueller, Windows Administration at the Command Line for Windows Vista, Windows 2003, Windows XP, and Windows 2000, John Wiley & Sons, 2007, ISBN 978-0470165799

External links