DOS attrib command question

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

I have a directory that has many subdirectories, and all files are read
only. I want to disable read only.

I do the following, but file not found error:

C:\temp>attrib -r *.*
File not found - *.*

any ideas? thanks!!
 
Matt said:
I have a directory that has many subdirectories, and all files are read
only. I want to disable read only.

I do the following, but file not found error:

C:\temp>attrib -r *.*
File not found - *.*

You were attempting to run that command on a folder
with no files in it.

To also check subfolders, you simply need to add the
usual /s switch: attrib -r /s *.*
 
Forget about the "read only" attribute for folders. It has nothing to do
with folders, only files.
 
Bob said:
Forget about the "read only" attribute for folders. It has nothing to do
with folders, only files.

C:\>mkdir test

C:\>attrib +r test

C:\>rmdir test
Access is denied.

aD
 
quoting:
C:\>mkdir test

C:\>attrib +r test

C:\>rmdir test
Access is denied.

aD


Try this, I didn't get any errors.

C:\>mkdir test
C:\>attrib test +s +h +r
C:\>attrib test -s -h -r
C:\>rmdir test
 
JM said:
quoting:




Try this, I didn't get any errors.

C:\>mkdir test
C:\>attrib test +s +h +r

Ah, but insert your "rmdir test" right here and you most
certainly will - which is exactly the point the previous
poster was trying to make. Before him, someone asserted
that read-only was for files only and not folders - he was
merely proving that person wrong be demonstrating that folders
can indeed by made read-only.
 
Rob said:
Ah, but insert your "rmdir test" right here and you most
certainly will - which is exactly the point the previous
poster was trying to make. Before him, someone asserted
that read-only was for files only and not folders - he was
merely proving that person wrong be demonstrating that folders
can indeed by made read-only.

Would have replied myself but I've not been paying attention :-)
That is indeed what my post was showing.

aD
 
After you believe you have made the directory "readonly" please open the
containing folder in "Explorer" and then r-click and delete the
"readonly" folder. You will find that it's no longer there. Said
"readonly" attribute is ignored.

Now back to Matt. Please use the "/S" switch to affect said files in the
sub-directories. For usage see "ATTRIB /?"
 
quoting:
Would have replied myself but I've not been paying attention :-)
That is indeed what my post was showing.

aD


I did not understand aD's original post. The OP wanted to know why
attrib -r *.* didn't work for all files under multiple directories, so
somebody dropped in the /S option. aD's post shows that you can't
rmdir a directory that is marked read-only, and with no apparent
reason for the post. Why? Where does that fall into place? It
doesn't seem to fit in. I'm confused.
 
JM said:
quoting:




I did not understand aD's original post. The OP wanted to know why
attrib -r *.* didn't work for all files under multiple directories, so
somebody dropped in the /S option. aD's post shows that you can't
rmdir a directory that is marked read-only, and with no apparent
reason for the post. Why? Where does that fall into place? It
doesn't seem to fit in. I'm confused.

aD's post was because someone else posted something saying
that the read-only attribute is for files only, not folders.

aD merely posted a simple example that proves that +r
does indeed apply to folders as well as files: if you
want to use rd (AKA rmdir) on a read-only folder, you
need to remove the read-only attribute first.
 
Back
Top