home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.update.uu.se
/
ftp.update.uu.se.2014.03.zip
/
ftp.update.uu.se
/
pub
/
rainbow
/
msdos
/
decus
/
RB125
/
attrib.txt
< prev
next >
Wrap
Text File
|
1995-06-04
|
39KB
|
1,149 lines
ATTRIB
File Attribute Manipulation Utility
Reference Manual
February 1987
This document describes the ATTRIB File Attribute Manipulation
Utility. This utility is unlicensed and unsupported.
Revision/Update Information: This is a new manual.
Operating System and Version: MS-DOS* version 2.10 or later.
Software Version: ATTRIB version 1.0
Support: THIS SOFTWARE IS
NOT
SUPPORTED BY
DIGITAL EQUIPMENT CORPORATION.
Direct Questions and Comments To: Brian Hetrick
ZKO1-3/J10
Digital Equipment Corporation
110 Spit Brook Road
Nashua NH 03062-2698
USA
* MS-DOS is a trademark of Microsoft Corporation.
Digital Equipment Corporation Maynard Massachusetts
February 1987
The information in this document is subject to change without notice
and should not be construed as a commitment by Digital Equipment
Corporation. Digital Equipment Corporation assumes no responsibility
for any errors that may appear in this document.
The software described in this document is unlicensed and unsupported.
Digital
Equipment
Corporation
assumes
no
responsibility
for
the
use
or
reliability
of
this
software
. This software is provided "as is,"
without any warranty of any kind, express or implied. Digital
Equipment Corporation will not be liable in any event for any damages
including any loss of data, profit, or savings, claims against the
user by any other party, or any other incidental or consequential
damages arising out of the use of, or inability to use, this software,
even if Digital Equipment Corporation is advised of the possibility of
such damage.
This documentation and the software it describes have been placed into
the public domain by Digital Equipment Corporation.
The following are trademarks of Digital Equipment Corporation:
DEC MASSBUS RSX VAX
DECmate PDP RT VAXcluster
DECnet P/OS ULTRIX VAXmate
DECUS Professional ULTRIX-32 VMS
DECwriter Rainbow ULTRIX-32M VT
DIBOL RSTS UNIBUS Work Processor
| | | | | | | |
|d|i|g|i|t|a|l|
|
|
|
|
|
|
|
|
Contents
Page
Preface v
Intended Audience v
Structure of This Document v
Associated Documents v
Conventions Used in This Document v
Acknowledgments vi
Summary 1
Format 1
Command Qualifiers 1
Command Parameters 1
Usage 1
Invoking 1
Exiting 1
Directing Output 2
Description 3
Invoking the File Attribute Manipulation Utility 3
Command Parameters 3
Display of File Names and Attributes 5
Command Qualifiers 6
Restrictions 6
Command Qualifiers 7
/HELP Command Qualifier 7
Format 7
Description 7
Example 7
/LOG Command Qualifier 8
Format 8
Description 8
Example 8
/RESET Command Qualifier 9
Format 9
Description 9
Example 10
/SET Command Qualifier 11
Format 11
Description 11
Example 12
Examples 13
Avoiding Full Backup After Restore 13
Avoiding Full Backup After Failed Incremental Backup 13
Making a File Invisible 14
Making a File Visible 14
Making a File Unmodifiable 14
Making a File Modifiable 15
File Attribute Manipulation Utility
Preface
Preface
Intended
Audience
This manual is intended for all MS-DOS users.
Structure
of
This
Document
This document has four major sections:
o The Summary section is an overview of the File Attribute
Manipulation Utility and is intended as a quick reference
guide. The Format subsection describes the command that
invokes the File Attribute Manipulation Utility, listing all
command qualifiers and parameters. The Usage subsection
describes how to invoke the File Attribute Manipulation
Utility and how to redirect output.
o The Description section explains how to use the File
Attribute Manipulation Utility and lists any restrictions you
should be aware of.
o The Command Qualifier section describes each command
qualifier. This section lists the command qualifiers in
alphabetical order.
o The Examples section contains examples of common operations
that you perform with the File Attribute Manipulation
Utility.
Associated
Documents
To use the File Attribute Manipulation Utility, you should also
be familiar with the following manual:
o
MS-DOS
User's
Guide
, or
Disk
Operating
System
manual, as
appropriate.
Conventions
Used
in
This
Document
Convention Meaning
E>
ATTRIB
/SET:SYSTEM
*.*
Command examples show output lines
or prompting characters that the
system prints or displays in normal
type. All user-entered commands
are shown in
bold
type.
v
File Attribute Manipulation Utility
Preface
/[NO]LOG Format descriptions use square
brackets to indicate that the
enclosed item is optional.
ATTRIB
wildspec
[
qualifier
] Format descriptions show all
portions of the command or command
qualifier. Upper case letters and
special characters must be entered
exactly as shown. Lower case
italic letters indicate portions of
the command for which you must
substitute values which determine
the effect of the command.
/SET:(
value
[,
value
]...) Ellipses (...) in format
descriptions indicate that the
immediately preceding item may be
repeated several times.
<CTRL/x> The symbol <CTRL/x> indicates that
you must press the key labeled CTRL
while you simultaneously press
another key, for example, <CTRL/C>.
Acknowledgments
The ATTRIB File Attribute Manipulation Utility uses the public
domain command line parsing package written by Bela Lubkin of
Borland International Inc.
Several employees of Digital Equipment Corporation served as beta
testers for various preliminary versions of this documentation
and the software it describes. The author thanks these persons
for their contribution to this utility.
vi
File Attribute Manipulation Utility
Summary
Summary
The ATTRIB File Attribute Manipulation Utility displays, sets,
and resets attributes of files.
Format
ATTRIB [
wildspec
]... [
qualifier
]...
Command
Qualifiers
Defaults
/[NO]HELP /NOHELP
/[NO]LOG /LOG
/RESET:
value
[none]
/SET:
value
[none]
Command
Parameters
wildspec
A path specification, the last component of which may
contain wild card characters, describing the files whose
attributes are to be displayed, set, or reset. If several
path specifications are given, each is processed in turn.
Command parameters and command qualifiers may be given in any
order.
Usage
Invoking
You invoke the File Attribute Manipulation Utility with the
ATTRIB command.
Exiting
You exit the File Attribute Manipulation Utility normally by
waiting until processing is complete. The File Attribute
Manipulation Utility will return control to the command
interpreter when processing is complete.
You can exit the File Attribute Manipulation Utility
abnormally by typing <CTRL/C>, if the /NOLOG command
qualifier has not been given or if the MS-DOS BREAK
parameter is ON.
1
File Attribute Manipulation Utility
Summary
Directing
Output
By default, messages from the File Attribute Manipulation
Utility are directed to the console device. Such messages
may be redirected to another device or a file with the I/O
redirection facilities of the command interpreter.
2
File Attribute Manipulation Utility
Description
Description
The File Attribute Manipulation Utility is a command-line
oriented program used to display, set, and reset file system
attributes of individual files or groups of files.
Through the use of the File Attribute Manipulation Utility, you
can display the names of hidden and system files, protect files
against alteration or deletion, make files eligible or ineligible
for display with the MS-DOS DIR command, and force files to be
backed up or not backed up with an incremental backup utility.
Invoking
the
File
Attribute
Manipulation
Utility
You invoke the File Attribute Manipulation Utility with the
ATTRIB command, optionally followed by one or more wild card path
specifications of the files whose attributes are to be displayed
or manipulated.
If you do not specify any wild card path specifications and also
do not specify any command qualifiers, the File Attribute
Manipulation Utility will display the names and attributes of all
files in the current directory of the volume in the current
drive.
If you specify command qualifiers other than /HELP but do not
specify any wild card path specifications, the File Attribute
Manipulation Utility will take no action.
If you specify at least one wild card path specification, the
File Attribute Manipulation Utility will process all files with
names matching the wild card path specifications and then exit.
Command
Parameters
The File Attribute Manipulation Utility processes the files whose
names are selected by the wild card path specifications. For
example, the following command displays the attributes and names
of all files on the current directory of the volume in drive C:
3
File Attribute Manipulation Utility
Description
E>
ATTRIB
C:*.*
ATTRIB version 1.0
C:\*.*:
IBMBIO.COM Arc R/O Hid Sys
IBMDOS.COM Arc R/O Hid Sys
AUTOEXEC.BAT Arc
BIN Dir
LIB Dir
USR Dir
CONFIG.SYS Arc
M2LOD Dir
M2LIB Dir
If a drive letter is specified in a wild card path specification,
the path is interpreted as residing on the volume in the
specified drive. Otherwise, the path is interpreted as residing
on the current default drive. If the path starts with a back
slash (\), the path is interpreted as relative to the root
directory of the volume. Otherwise, the path is interpreted as
relative to the current default directory of the volume. In all
of these cases, the absolute form of the wild card path
specification is displayed, followed by a line for each of the
files selected by the wild card path specification.
The last component of the path specifications given in the
command may contain wild card characters. An asterisk (*) in the
file name portion of the last component of the path specification
indicates that all files whose names match the portion of the
file name before the asterisk will match the file name portion.
An asterisk as the first or only character of the file name
portion of the last component of the path specification will
match the file name of all files. Similarly, an asterisk in the
file extension portion of the last component of the path
specification indicates that all files whose extensions match the
portion of the file extension before the asterisk will match the
file extension portion. An asterisk as the first or only
character of the file extension portion of the last component of
the path specification will match the file extension of all
files.
A question mark (?) in any position of the last component of the
path specification will match any single character in a file name
or file extension. Question marks as the last characters of the
file name or file extension portions of the last component of the
path specification will also match null (nonexistent) characters
of the file name or file extension.
If the current directory on the volume in drive B is the root
directory, then the command:
4
File Attribute Manipulation Utility
Description
E>
ATTRIB
B:???.D*
will list the attributes and names of all files in the root
directory of the volume in drive B whose file names are at most
three characters long, and whose file extensions start with the
letter D.
Except in the root directory of a volume, a single period (.) in
the place of a directory name refers to the directory which would
be specified in the absence of the period, while two periods (..)
refers to the parent of the directory which would be specified in
the absence of the two periods. When the directory which would
be specified without the periods is the root directory of a
volume, both a single period and two periods refers to the root
directory. A single back slash also refers to the root directory
of a volume.
If the path specification ends in either a colon (:) or a back
slash (\), the File Attribute Manipulation Utility appends the
wild card specification *.* to the path appearing in the command
line. For example, the command:
E>
ATTRIB
A:
lists the attributes and names of files in the current directory
of the volume in drive A.
Display
of
File
Names
and
Attributes
The File Attribute Manipulation Utility lists the attributes and
names of the files matching each the wild card path specification
in the following format:
pathspec:
filename.ext Arc Dir R/O Hid Sys
"Pathspec" is the wild card path specification specified in the
command line, expressed in absolute terms. It includes a drive
letter and a complete path specification relative to the root
directory of the volume in the drive.
"Filename.ext" is the name of a file selected by the path
specification, relative to the directory containing the last
component of the path specification.
"Arc," if present, indicates that the file has the "archive"
attribute set. This attribute is set whenever the file is
written to, and is reset only by specific programmed requests.
This attribute is often used by incremental backup utilities to
determine whether a file has changed since the last backup.
5
File Attribute Manipulation Utility
Description
"Dir," if present, indicates that the file has the "directory"
attribute set. This attribute is set when the file is an MS-DOS
subdirectory, rather than a data file.
"R/O," if present, indicates that the file has the "read only"
attribute set. This attribute prevents the file from being
written to or deleted.
"Hid," if present, indicates that the file has the "hidden"
attribute set. This attribute prevents the file from being found
by normal directory searches, such as used by the MS-DOS DIR
command.
"Sys," if present, indicates that the file has the "system"
attribute set. This attribute prevents the file from being found
by normal directory searches, such as used by the MS-DOS DIR
command.
Command
Qualifiers
You can obtain a description of the File Attribute Manipulation
Utility's command parameters and command qualifiers with the
/HELP command qualifier.
You can suppress the listing of the file names and attributes
with the /NOLOG command qualifier.
You can modify the attributes of the files selected with the
/RESET and /SET command qualifiers. In this case, the attributes
listed are the file attributes as modified by the /RESET and /SET
command qualifiers, rather than the file attributes before
modification.
Restrictions
You cannot set or reset the directory attribute of a file. This
is a limitation of the MS-DOS file system.
You can use wild card characters only in the last component of a
path specification. This is a limitation of the directory search
process provided by the MS-DOS operating system.
6
File Attribute Manipulation Utility
Command Qualifiers
/HELP
Command
Qualifier
Format
/HELP
/NOHELP
Description
By default, the File Attribute Manipulation Utility does not give
a description of the command parameters and command qualifiers it
accepts. The /HELP command qualifier controls the generation of
this description of command parameters and command qualifiers.
If you specify /HELP, the description is produced. If you omit
the qualifier or specify /NOHELP, no description is produced.
The HELP keyword may be abbreviated to any leading substring
which does not also abbreviate another command qualifier. The
minimum abbreviation of the HELP keyword is H. The minimum
abbreviation of the NOHELP negated keyword construct is NOH.
If the /HELP command qualifier is specified several times in a
single command, the rightmost occurrence of the qualifier is
effective.
Example
E>
ATTRIB
/HELP
ATTRIB version 1.0
Command line: ATTRIB filespec [qualifier]...
'filespec' is a path specification possibly with wild card characters
in the last component
'qualifier' is one of /[NO]HELP, /[NO]LOG, /SET:value, /RESET:value,
/CLEAR:value, /REMOVE:value
/SET grants attributes
/RESET, /CLEAR, and /REMOVE remove attributes
'value' is either name or (name[,name]...)
'name' is one of ARCHIVE, HIDDEN, SYSTEM, READ
ONLY
All keywords may be uniquely abbreviated
7
File Attribute Manipulation Utility
Command Qualifiers
/LOG
Command
Qualifier
Format
/LOG
/NOLOG
Description
By default, the File Attribute Manipulation Utility lists the
attributes and names of all files selected by the command line.
The /LOG command qualifier controls this listing of file
attributes and names. If you specify /NOLOG, no listing is
produced. If you omit the qualifier or specify /LOG, the listing
is produced.
The LOG keyword may be abbreviated to any leading substring which
does not also abbreviate another command qualifier keyword. The
minimum abbreviation of the LOG keyword is L. The minimum
abbreviation of the NOLOG negated keyword construct is NOL.
If the /LOG command qualifier is specified several times in a
single command, the rightmost occurrence of the qualifier is
effective.
Example
E>
ATTRIB
/SET:SYSTEM
*.*
/NOLOG
ATTRIB version 1.0
E>
ATTRIB
*.*
ATTRIB version 1.0
E:\*.*:
ABSTRACT Dir Sys
M2LIB Dir Sys
M2LOD Dir Sys
E>
ATTRIB
*.*
/RESET:SYSTEM
/LOG
ATTRIB version 1.0
E:\*.*:
ABSTRACT Dir
M2LIB Dir
M2LOD Dir
8
File Attribute Manipulation Utility
Command Qualifiers
/RESET
Command
Qualifier
Format
/RESET:
value
/RESET:(
value
[,
value
]...)
/CLEAR:
value
/CLEAR:(
value
[,
value
]...)
/REMOVE:
value
/REMOVE:(
value
[,
value
]...)
Description
By default, the File Attribute Manipulator Utility leaves
unchanged the attributes of the files selected by the wild card
path specifications. The /RESET command qualifier directs the
File Attribute Manipulation Utility to reset (remove) specific
attributes for the selected files. The value specified for the
/RESET command qualifier may be a single item from the list:
ARCHIVE - Specifying this item directs the File Attribute
Manipulator Utility to reset the "archive" attribute
HIDDEN - Specifying this item directs the File Attribute
Manipulator Utility to reset the "hidden" attribute
READ
ONLY - Specifying this item directs the File Attribute
Manipulator Utility to reset the "read only" attribute
SYSTEM - Specifying this item directs the File Attribute
Manipulator Utility to reset the "system" attribute
The value specified for the /RESET command qualifier may also be
a combination of these values, separated by commas and enclosed
in parentheses.
The ARCHIVE, HIDDEN, READ
ONLY, and SYSTEM keywords may be
abbreviated to any leading substring which does not also
abbreviate another of these keywords. The minimum abbreviations
of these keywords are A, H, R, and S, respectively.
The CLEAR, REMOVE, and RESET keywords are synonyms. The CLEAR,
REMOVE, and RESET keywords may be abbreviated to any leading
substring which does not also abbreviate another command
qualifier keyword. The minimum abbreviation of these keywords
are C, R, and R, respectively. R and RE are accepted for both
the REMOVE and RESET keywords as these keywords are synonyms.
An equals sign (=) may be used in place of a colon (:) to
separate the command qualifier keyword from the command qualifier
9
File Attribute Manipulation Utility
Command Qualifiers
value.
If the /RESET command qualifier is specified several times in a
single command, attributes appearing in any of the /RESET command
qualifiers are reset.
No item specified in the /RESET command qualifier may also be
specified in the /SET command qualifier.
Example
E>
ATTRIB
G:\BIN\C*.COM
/SET:(ARCHIVE,HIDDEN,READ
ONLY,SYSTEM)
ATTRIB version 1.0
G:\BIN\C*.COM:
CHKDSK.COM Arc R/O Hid Sys
COMMAND.COM Arc R/O Hid Sys
E>
ATTRIB
G:\BIN\C*.COM
/RESET:HIDDEN
ATTRIB version 1.0
G:\BIN\C*.COM:
CHKDSK.COM Arc R/O Sys
COMMAND.COM Arc R/O Sys
10
File Attribute Manipulation Utility
Command Qualifiers
/SET
Command
Qualifier
Format
/SET:
value
/SET:(
value
[,
value
]...)
Description
By default, the File Attribute Manipulator Utility leaves
unchanged the attributes of the files selected by the wild card
path specifications. The /SET command qualifier directs the File
Attribute Manipulation Utility to set specific attributes for the
selected files. The value specified for the /SET command
qualifier may be a single item from the list:
ARCHIVE - Specifying this item directs the File Attribute
Manipulator Utility to set the "archive" attribute
HIDDEN - Specifying this item directs the File Attribute
Manipulator Utility to set the "hidden" attribute
READ
ONLY - Specifying this item directs the File Attribute
Manipulator Utility to set the "read only" attribute
SYSTEM - Specifying this item directs the File Attribute
Manipulator Utility to set the "system" attribute
The value specified for the /SET command qualifier may also be a
combination of these values, separated by commas and enclosed in
parentheses.
The ARCHIVE, HIDDEN, READ
ONLY, and SYSTEM keywords may be
abbreviated to any leading substring which does not also
abbreviate another of these four keywords. The minimum
abbreviations of these keywords are A, H, R, and S, respectively.
The SET keyword may be abbreviated to any leading substring which
does not also abbreviate another command qualifier keyword. The
minimum abbreviation of the SET keyword is S.
An equals sign (=) may be used in place of a colon (:) to
separate the command qualifier keyword from the command qualifier
value.
If the /SET command qualifier is specified several times in a
single command, attributes appearing in any of the /SET command
qualifiers are set.
No item specified in the /SET command qualifier may also be
11
File Attribute Manipulation Utility
Command Qualifiers
specified in the /RESET command qualifier.
Example
E>
ATTRIB
G:\BIN\C*.COM
/SET:(HIDDEN,ARCHIVE)
ATTRIB version 1.0
G:\BIN\C*.COM:
CHKDSK.COM Arc Hid
COMMAND.COM Arc Hid
12
File Attribute Manipulation Utility
Examples
Examples
Avoiding
Full
Backup
After
Restore
Many file backup and restore utilities permit incremental
backups, where only files having the archive attribute are copied
from the disk being backed up to the backup media. These
utilities generally exactly restore the files' attributes when
such files are restored. At the next incremental backup, all
restored files are backed up again, as they have the archive
attribute, this being the reason they were included in the first
backup.
You can use the File Attribute Manipulation Utility to reset the
archive attributes of such files, making them ineligible for an
incremental backup. This is useful when large files are restored
from a previous backup, and it is not desired to back up these
files yet again. The command:
E>
ATTRIB
/RESET:ARCHIVE
*.*
will reset the archive attribute of all files in the current
directory of the current drive, making these files ineligible for
future incremental backups until their contents are changed.
Avoiding
Full
Backup
After
Failed
Incremental
Backup
Many file backup and restore utilities permit incremental
backups, where only files having the archive attribute are copied
from the disk being backed up to the backup media. Some of these
utilities remove the archive attribute from files as the files
are copied to the backup media, before it is known whether the
backup as a whole is successful. With such utilities, if the
backup process fails before completion, the files may be
unrecoverable from the backup media created by the failed backup
process. Even after the cause of the backup utility's failure
has been removed, an incremental backup will not back up the
files whose archive attributes were removed by the failed backup
process.
You can use the File Attribute Manipulation Utility to set the
archive attribute of the files whose archive attribute has been
removed by a failed incremental backup. The command:
E>
ATTRIB
/SET:ARCHIVE
*.*
will give the archive attribute to all files in the current
directory of the current drive, making these files eligible for a
future incremental backup.
13
File Attribute Manipulation Utility
Examples
Making
a
File
Invisible
You can use the File Attribute Manipulation Utility to make a
file undetectable through normal directory searches, such as used
by the MS-DOS DIR command. Files with either the hidden
attribute or the system attribute are not found through normal
directory searches. The command:
E>
ATTRIB
/SET:HIDDEN
filename
will set the hidden attribute of the file specified by
filename
,
and so make it undetectable through normal directory searches.
If
filename
specifies a subdirectory, then it will not appear in
directory listings, but otherwise will act normally.
Making
a
File
Visible
You can use the File Attribute Manipulation Utility to make a
file which has one or both of the hidden and system attribute
detectable through normal directory searches, such as used by the
MS-DOS DIR command. The command:
E>
ATTRIB
/RESET:(HIDDEN,SYSTEM)
filename
will reset the hidden and system attributes for the file
specified by
filename
.
As files with the hidden or system attributes are not detectable
through normal directory searches, a utility that uses special
directory searches must be used to detect their presence. The
File Attribute Manipulator Utility uses such searches. The
command:
E>
ATTRIB
*.*
will list the attributes and names of all files in the current
directory, including files with the hidden or system attributes.
Making
a
File
Unmodifiable
You can make a file ineligible to be written upon or deleted,
with the File Attribute Manipulation Utility. This protects the
files against accidental deletion or modification. The command:
E>
ATTRIB
/SET:READ
ONLY
filename
gives the file specified by
filename
the read only attribute.
The MS-DOS operating system will not permit a file with the read
only attribute to be written upon or deleted. To modify or
delete the file, it is first necessary to remove the read only
14
File Attribute Manipulation Utility
Examples
attribute.
Making
a
File
Modifiable
You can make a file which has the read only attribute eligible
for modification and deletion using the File Attribute
Manipulation Utility. This would be necessary, for example, if
you wanted to delete a data file which contained obsolete
information, but which had been protected against accidental
modification or deletion. The command:
E>
ATTRIB
/RESET:READ
ONLY
filename
removes the read only attribute from the file specified by
filename
. The MS-DOS operating system will then permit the file
to be written upon or deleted.
15