Solved

Read Only attribute cannot clear

Posted on 2010-11-27
12
673 Views
Last Modified: 2012-05-10
I cannot clear the read only attribute from all of the folders on my flash drive. I have a Windows XP box.

I have tried to take over the file permissions.

I have tried the command line attrib -r +s stuff.

No luck.
0
Comment
Question by:seramai
  • 5
  • 2
  • 2
  • +2
12 Comments
 
LVL 47

Expert Comment

by:dbrunton
Comment Utility
Let's see.  Assuming your flash drive is H: and you are Administrator.

attrib    -s    H:\*.*     /s     /d
attib     -r     H:\*.*     /s     /d
0
 

Author Comment

by:seramai
Comment Utility
Did not work. See attached.
--Doc1.docx
0
 
LVL 7

Assisted Solution

by:YarnoSG
YarnoSG earned 100 total points
Comment Utility
If the files have been "Customized" to use an XP view (like say for example "Media folder") the Read Only flag will be set on the FOLDER, but not its contents.  You can read and write files into the folder even when this is set-  using attrib as dbruinton suggests will not remove this "attribute".  Read this KB article for more information:  http://support.microsoft.com/kb/812003
0
 
LVL 7

Expert Comment

by:YarnoSG
Comment Utility
Also, since you said this was on a flash drive, does the drive in question have a read-only or "lock" switch on it?
0
 

Author Comment

by:seramai
Comment Utility
Drive does not have a lock on it.

Cannot save changes to files opened from flash drive.
0
 
LVL 51

Assisted Solution

by:HainKurt
HainKurt earned 100 total points
Comment Utility
copy files to hdd, do it on hdd
format card and copy ;)
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 47

Assisted Solution

by:dbrunton
dbrunton earned 100 total points
Comment Utility
>>  Cannot save changes to files opened from flash drive.

Give us an example - file type please like a Word document.

Normally I'd expect there to be a warning on opening that this is a read only file.
0
 

Author Comment

by:seramai
Comment Utility
Word and Excel files.
0
 
LVL 11

Accepted Solution

by:
ocanada_techguy earned 200 total points
Comment Utility
Usually this happens when more than one computer is involved.  Since this is a flash drive I am thinking that's probable.  We also see this with external hard disks.

It's not really the read-only "attribute" in the old DOS/Win9X fat sense that is the problem, it is a priviledges, that is a PERMISSIONS and OWNERSHIP issue, which Windows NT/XP/2K/7/etc enforce regardless of whether it is FAT/FAT32 or NTFS4/5

Let's say you're on computer A, you create a folder on the stick.  The owner will be user M of computer A, probably belonging to the Administrators group of machine A, but perhaps just the Users group of A.  In any case, the default permissions on the folder are such that the owner is M, and members of the A\Administrators have full control, and perhaps A\Users does too, or not.  There is a special built-in group called "Everyone" and that only has read priviledge.

This often happens when on machine A when managing user M in control panel the user elected to check that attribute that says keep my files and folders "private"  As an aside, obviously at that time if one had chosen to encrypt one's files, and/or had chosen encryption on the stick, that would be another problem on top.

Now when you go to machine B, user N on machine B  is not the owner and only has read permission (the tickbox attribute having nothing to do with it)

Now one of the obstacles is often that over on machine B, or C, D etc, it may be that THOSE machines are set to "use simple file sharing (recommended)", so that if you look at the properties of the folder(s) and click Advanced, the OS is still keeping the elaborate ownership and permission priviledges dialogs under the blankets such that you do not see them.  In Explorer, if you click Tools, Folder Options, View, and scroll to the bottom of the list, the Use Simple file sharing mode is checked or not.

You can either deal with thepermission ownership issue by examining the Advanced security permissions and ownership with Simple file sharing turned off over on machine A where this all happened, or else deal with it on machine B where you are facing the problem.

On machine B, once simple sharing is turned off, go to the folder on the flash drive and then do Properties, and look at the Advanced Security.  You will notice that instead of showing the permissions as machineA\userM it is a {018364seeminglyrandom}\ GUIDs, those are the Globally Unique Identifiers (GUIDs) of the "other" machine A user M, but since machine B and A don't participate in a domain security model, it cannot sustitute the correct friendly name of other machines it is not sharing the same security with.

There are a couple of fixes.  If you want to leave all this security nonsense alone, you could copy the files to the local drive of machine B unser user N where you then will have ownership and permission.

OR... you can change the permission on the folder(s) on the flash drive... one of two ways.  You can either chageit so the special uiversal catch-all user called "Everyone" has full or write or sufficient permission, or... you can ADD MachineB\Users group and/or MachineB\Administrators group and/or machineB\UserN to the permissions with full or sufficient priviledge.  I say ADD and NOT change because if you change or remove the GUIDs representing machine A, then you'll have the problem again when returning to machine A.

The "Everyone" means you've opened it wide-up, so any other machine C, D, E etc it will also have permission.  If you do machine specific by adding, then the mahine A and machine B have full/Sufficient permission but not others.  That would be some small measure of safety precaution or security that anyone on any other machine would have to go through this exact same rig-a-ma-roll to overcome, not that it is that difficult to overcome when you know how.  Encryption on the other hand, that is way more secure.

In order to change the permissions, you're going to need to be the owner or have administrative rights.  HOWEVER as it stands at the moment as yet the Administrators group and Owner are probably also showing as GUIDs from a different machine, machine A's not machine B's,  so to "correct" the permissions it will probably say you need to take ownershiip.

The way folder permissions work, as a general rule all these permissions are set-up for the PARENT folder and then all files and subfolders underneath are set to "Inherit permissions".  So instead of trying to fix the permissions one-by-one or tens or hundreds or thousands of objects, change it on the parent folder, and by default the inheritance is also done, unless you change some of the checkboxes about inheritance in which case you'll end up changing one object not all of them.
0
 
LVL 11

Expert Comment

by:ocanada_techguy
Comment Utility
By the way, unlike the network user sharing, it does NOT matter if you made a user with the same "friendly name" and password on both machines, user "Fred" or "Seramai" on machine A is NOT ever considered the same as "Fred" or "Seremai" on machine B, the GUIDs are different.   (Joining a domain security model at all machines would keep it the same, but you'd face the same problem as soon as you go to a machine not part of the domain)

I'll add, once rectified you can turn simple file sharing back on again, which as a rule helps avoid such complexity and confusion, unless as we said, in control panel a user has asked for their files to be kept private from other machine A users, which certainly means they're also semi-private from users on B, C, etc.
0
 

Author Comment

by:seramai
Comment Utility
Ok a little more info here.

I have done the administrative rights thing and that does not seem to help.

What this stems from is I removed the TrueCrypt volume from my flash drive, reformatted the flash drive and dumped everything back on it with the result being every folder and every file in every folder being read only.

By way of an aside, I don't understand why it is necessary for the OS to do that. I don't understand the thinking behind this.

Also, the folders on my desktop are read only, but the file contents are not.

Yet, when I copy the stuff off my flash drive and into a new folder on the desktop, both the folder and the contents of the folder are read only.

This is maddening.

I am going to reformat the flash drive again and add files back to see what happens.

0
 

Author Comment

by:seramai
Comment Utility
Never mind. I just did the sharing thing and that unchecked the read only attribute of the content of the file folders.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

There are 2 things you must have in order to connect to the internet behind a router, The "Gateway IP" of the router, which is usually something like 192.168.xxx.1, I've seen routers with default values of: 192.168.0.1, 192.168.1.1, 192.168.11.1, …
We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now