|
This article does not cite any references or sources. Please help improve this article by adding citations to reliable sources. (help, get involved!) Unverifiable material may be challenged and removed.
attrib is a DOS command, supported since version 1.0. The function of attrib is to set and remove data attributes (read-only, archive, system and hidden). Instructions on how to use the directory command. ...
Syntax
attrib -h -r c:system.dat Removes the hidden (h) and read-only attributes of the (r) "c:system.dat" file. attrib +a +s c:windowswin.ini Adds the archive (a) and system (s) attributes to the "c:windowswin.ini" file. attrib +r c:windows*.* Adds the read-only attribute (r) to all files in the "c:windows" folder. attrib +a c:windows*.* /s Adds the archive (a) attribute to all files in the "c:windows" folders and its' subfolders. attrib +a c:windows*.* /s /d Adds the archive (a) attribute to all files in the "c:windows" folders, its' subfolders and the folders themselves.
Particularities - In certain versions, when both the s and h attributes are set, they can only be removed at the same time. To remove only one, they must both be removed at the same time, and then the desired attribute must be set.
- Undocumented: If a comma is typed directly after the command's name (for example,
attrib, *.txt), all attributes will be removed from the targeted files (in this case, all .txt files in the folder). In most versions, if a target isn't specified, then all attributes will be removed from the folder currently being browsed in DOS. See also | view • talk • edit Windows command line programs and builtins (more) | | Basic file and file system management: | attrib | cd | chdir | copy | del | dir | erase | format | md | mkdir | move | rd | rename | ren | rmdir | type | xcopy | | Advanced file and file system management: | assoc | cacls | chkdsk | chkntfs | comp | compact | convert | diskcomp | diskcopy | fc | ftype | label | recover | replace | subst | tree | verify | vol | | User management/environment: | chcp | color | date | graftabl | mode | path | popd | pushd | set | time | title | ver | | Shell programming: | break | call | cmd | doskey | echo | endlocal | exit | for | goto | if | pause | prompt | rem | setlocal | shift | Printing: | print | | Process management: at | start | Text processing: more | sort | | Searching: find findstr | Miscellaneous: cls | help | |