5.377 bytes

Service Hints & Tips

Document ID: MCGN-3G6SBK

Aptiva - The ATTRIB command

Applicable to: World-Wide

The ATTRIB command is executed from the DOS command prompt. It turns on or off the archive, read-only, system, and hidden file attributes. This command may be issued for one file in a directory, selected files in a directory, or all files in a directory.

The archive bit is a file attribute that is set to on when a file is changed. Changing the archive bit affects the operation of many backup and copy programs. If the archive bit is turned off, the file is usually not backed-up. If you have changed the archive bits of any of your files, the files may not be backed-up, depending on the settings in your backup program.

The read-only attribute allows you to protect your files. If the read-only attribute for a file is turned on, the file cannot be changed or deleted. This often causes problems when you are trying to delete software applications. If you have a read-only file, it cannot be deleted. Therefore, you cannot remove the directory that the file is stored in. If you turn the read-only attribute off, the file can be deleted; thus, the directory can be deleted.

The system attribute is generally associated with system files and should not be changed, unless specifically instructed to do so. Deleting a file with the system attribute could cause the system to fail.

The hidden attribute allows files to be hidden from general view. These files do not appear in regular directory listings. (To see a directory listing, including hidden files, use the following command: DIR /AH). The hidden file attribute is generally associated with system files and is designed to hide files from view so that they are not accidentally deleted. Please verify before deleting a hidden file.

You can modify the ATTRIB command's parameters so that it only changes the attribute that you want. You can also use it to display a file's attribute without changing it in any way.

The syntax for the command is as follows:

ATTRIB [parameters] [drive:] [\path] [\filename]

ATTRIB command parameters are:

+R = turns on the read-only attribute of a file.

-R = turns off the read-only attribute of a file.

+S = turns on the system attribute of a file.

-S = turns off the system attribute of a file.

+H = turns on a hidden attribute of a file.

-H = turns off a hidden attribute of a file.

+A = turns on the archive bit of a file.

-A = turns off the archive bit of a file.

/? = lists all paramenter options.

/S = processess files in all directories in the specified path.

drive: = specifies the drive where the file(s) to be changed is located.

\path = specifies the directory where the file(s) can be located.

\filename = specifies the file(s) whose attribute(s) is to be changed.



If no parameters are specified, the ATTRIB command will list the file(s) specified and its attributes.

Search Keywords

Hint Category

DOS/Windows 3.x

Date Created

15-04-97

Last Updated

09-03-99

Revision Date

09-03-2000

Brand

IBM Aptiva

Product Family

Aptiva, PS/1

Machine Type

2134, 2136, 2137, 2138, 2140, 2142, 2144, 2159, 2161, 2162, 2168, 2176, 2011, 2121, 2123, 2133, 2155

Model

all

TypeModel

Retain Tip (if applicable)

Reverse Doclinks
and Admin Purposes