Change Attributes of Directory.

Using dos under win95.
How can I use dos to remove the attributes of a directory (by attributes I mean Hidden/System/ReadOnly etc). I have tried every combination of the Attrib command but this seems to be strictly limited to files not directories.

Any help very welcome.
Who is Participating?
jmeneesConnect With a Mentor Commented:
dont inclued brackets

 ATTRIB  [directoryname] To display the attributes of a directory:

 ATTRIB      [filename]  To display the attributes of a file:

To set or remove attributes of a file or directory:

ATTRIB [ +  - A] [ +   - H] [ +   - R] [ +   - S] [directory filename] [/S]

+ Sets an attribute. - Clears an attribute.
 A       Archive file attribute.
 H       Hidden file attribute.
 R       Read-only file attribute.
 S       System file attribute
 /S       Processes files in all directories in the specified path.

To hide the directory call test  c:\test
ATTRIB +H c:\test

To remove the hide
ATTRIB -H c:\test

To hide the files (but not the directories) in the C:\test
ATTRIB +H c:\test\*.*

you can add mult combos like

ATTRIB -H-S-R C:\test

The directory's Read-Only attribute can be set. But this seems to serve NO purpose at all. The attribute only applies to the directory only and NOT the files within the directory.

brockwayAuthor Commented:
Well yes that should work but try adding all the attributes to a directory (including hidden). Then coding

ATTRIB -h -s -R -A C:\Testdir\*.* /s

The files will have their attributes removed but the directory and any hidden subdirectory will continue to have the hidden attribute.

What am I  missing here?
brockwayAuthor Commented:
Increase in points for the genious that cracks this one!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.