|
ATTRIB
Displays file attributes. Typing ATTRIB on command line will
reveal the attributes of all the files in the current
directory even if they are hidden. ATTRIB will show
information that DIR will not.
Syntax
attrib [{+r|-r}] [{+a|-a}] [{+s|-s}] [{+h|-h}] [[Drive:][Path] FileName] [/s[/d]]
There are four flags that can be set by ATTRIB:
R - Read Only
A - Archive
S - System
H - Hidden
These are turned on by the + and off by -
/s : Applies attrib and any command-line options to
matching files in the current directory and all of
its subdirectories.
/d : Applies attrib and any command-line options to
directories.
This can also be done by right-clicking a file in Windows
and, selecting properties and general.
Typing ATTRIB and a filename will reveal the attributes of
that file. Example: ATTRIB C:\AUTOEXEC.BAT
Examples
ATTRIB +H C:\AUTOEXEC.BAT will turn the hidden flag on.
ATTRIB -H C:\AUTOEXEC.BAT will turn the hidden flag off.
ATTRIB +R +A +S +H C:\AUTOEXEC.BAT will turn all the flags
on,
ATTRIB -R -A -S -H C:\AUTOEXEC.BAT will turn them all off.
Batch File Commands
|