ATTRIB
This page was last modified 12:30, 1 June 2020 by Mars2000you. Based on work by Gdx.

Contents

Effect

Sets or changes the attributes of files under MSX-DOS 2 / Nextor to make them hidden or not hidden, read only or not read only, system file or not system file, archived or not archived.

Notes:

  • The files without attribute are not hidden, not read only, not system file, not archived file.
  • The DIR command can be used to indicate the current attributes of files.

Syntax

ATTRIB +|-R|H|S|A /S /H /P <Device>:\<Path>\<Filename> + <Device>:\<Path>\<Filename>...

Notes:

  • Character backslash (\) serves as a separator between the folders and the file name in MSX-DOS2. You don't have to put it after the colon of the device name. Backslash is replaced by the character yen (¥) on Japanese MSX or the character won (₩) on Korean MSX.
  • Character slash (/) serves to declare an option. You can put the options after the command or behind all other parameters.

Parameters

<Device> is the name for used device. It can only be a disk drive.

If you don't specify the drive, the computer will work with the currently active drive (by default, it's drive A:)

Device type Device name Remark
Disk drive A, B, C, D, E, F, G, H A floppy disk interface can control until 2 drives.


<Path> is used to specify the location in folders of file whose attributes need to be changed. Each folder name in path are separate by a backslash (\).

<Filename> is the file name concerned by the changing of attributes. Wildcards can replace some characters in filename to get several files. The asterisk (*) and question mark (?) are used as wildcard characters. The asterisk matches any sequence of characters, whereas the question mark matches any single character. If you don't specify a file name, all the files of the specified folder will be selected.

+H is used to mark the selected files as hidden - these files will not be affected by most commands or shown by the DIR command unless a /H option is given with those commands.

-H is used to mark the selected files as not hidden.

+R is used to mark the selected files as read only - these files can't be written to or changed.

-R is used to mark the selected files as not read only.

+S is used to mark the selected files as system files - these files will not be affected by most commands or shown by the DIR command unless a /S option is given with those commands. This parameter is available only since COMMAND2.COM 2.40.

-S is used to mark the selected files as not system files. This parameter is available only since COMMAND2.COM 2.40.

+A is used to mark the selected files as archived - Whenever a file has been written to and closed the archive bit is set. This bit can be examined by, for example, the XCOPY tool to determine whether the file has been changed. - This parameter is available only since COMMAND2.COM 2.40.

-A is used to mark the selected files as not archived. This parameter is available only since COMMAND2.COM 2.40.

/S is used to allow the changing of attributes for system files. This parameter is available only since COMMAND2.COM 2.40.

/H is used to allow the changing of attributes for hidden files.

/P is used to allow a pause at the end of the screen when displaying error messages.

MSX-DOS 2 / Nextor allows to change simultaneously the attributes of several specified (series of) files with the + part of the mentioned syntax.

Examples

Under MSX-DOS 2 / Nextor

A>ATTRIB +R FILE1
A>ATTRIB +H B:\DIR1\*.COM
A>ATTRIB -R -H \DIR1/H/P

Under MSX-DOS 2 / Nextor with COMMAND2.COM 2.40 and higher

A>ATTRIB +S \DIR1 + \DIR2 + FILE1
A>ATTRIB -S -A /S \DIR1 + \DIR2 + FILE1

Related to

COPY, DIR

Compatibility

MSX-DOS 2 / Nextor with COMMAND2.COM v2.20 and higher