Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: How to search for Explorer files that are read-only


11 Feb 2013   #1

Windows 7 Professional x64
 
 
How to search for Explorer files that are read-only

Hello,
I am trying to search for all Explorer files that have the read-only attribute set.
I can show the Attributes column in Explorer, and I can set Tools > Folder options... > View > Apply to Folders. This is helpful, but when I perform a search, the above options do not carry through to my search results view.
So I am hoping to use Advanced Query Syntax to find all read-only files.
Many thanks in advance for any suggestions.
Keith

My System SpecsSystem Spec
.

11 Feb 2013   #2

Windows 8 Core X64
 
 

You could do this from a command prompt using the dir /ar /s command. Pipe the output to a file for use later.

Start a command prompt.
Type dir /ar /s > ReadOnlyFIles.txt

Results will be in ReadOnlyFiles.txt when done.

Enter dir /? from a command prompt for usage.
My System SpecsSystem Spec
12 Feb 2013   #3
4wd

W8+8.1, W7 ult+hp, XP
 
 

The search in (the excellent) Freecommander filemanager does the job.
For paid programs, try FileLocator Pro.

Hope this helps (and, am awaiting the usual flak for recommending anything else than the built-in Windows 7 search).


Attached Thumbnails
How to search for Explorer files that are read-only-com-search.jpg  
My System SpecsSystem Spec
.


13 Feb 2013   #4

Windows 7 Professional x64
 
 

Thanks Ztruker and 4wd.
No flak, but I am indeed trying to do this within Windows Explorer. I will keep your ideas in mind in case I cannot achieve this.
Many thanks.
Keith
My System SpecsSystem Spec
14 Feb 2013   #5

Windows 8 Core X64
 
 

I don't believe you can do what you want in Windows Explorer. Command Prompt or another app is needed.
My System SpecsSystem Spec
14 Feb 2013   #6

Windows 7 Ultimate x86 build 7600 (XP, 98SE, 95, 3.11, DOS 7.10 on VM) + Ubuntu 10.04 LTS Lucid Lynx
 
 

It is possible to search for readonly files from explorer itself, but its a bit complicated.

You can do the search in the search box for "attributes"
Code:
attributes:<attribute code>
The attribute code is the complicated part. The file attribute constants are as follows
Code:
FILE_ATTRIBUTE_READONLY = 1
FILE_ATTRIBUTE_HIDDEN = 2
FILE_ATTRIBUTE_SYSTEM = 4
FILE_ATTRIBUTE_DIRECTORY = 16
FILE_ATTRIBUTE_ARCHIVE = 32
FILE_ATTRIBUTE_ENCRYPTED = 64
FILE_ATTRIBUTE_NORMAL = 128
FILE_ATTRIBUTE_TEMPORARY = 256
FILE_ATTRIBUTE_SPARSE_FILE = 512
FILE_ATTRIBUTE_REPARSE_POINT = 1024
FILE_ATTRIBUTE_COMPRESSED = 2048
FILE_ATTRIBUTE_OFFLINE = 4096
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 8192
For example, if a file has the attributes READONLY, HIDDEN and ARCHIVE, you will have to add the constants for the three.

1 + 2 + 32 = 35

Searching for "attributes:35" will list all the files with READONLY, HIDDEN and ARCHIVE attribute set.
Searching for "attributes:2081" will list all the files with READONLY, ARCHIVE and COMPRESSED attribute set.

You can also display the attributes in explorer as a column.
Right click on the column title, click on "More.." and select "Attributes"

This should give an idea about the attributes set for the files.

Source: Windows Search Advanced Query Syntax (AQS) and File Attributes
My System SpecsSystem Spec
15 Feb 2013   #7

Windows 7 Professional x64
 
 

Hello gladson1976,
Thanks for your reply. I was able to show folder using "attributes:16", but, even though I manually in Explorer set a file to read-only, I could not find any read-only files using "attributes:1".
So I remain confused. I am still curious as to how to do this in Explorer, but I just purchased File Locator Pro (recommended by 4wd above), and that solves the problem.
Thanks again to everyone for your responses.
Cheers,
Keith
My System SpecsSystem Spec
15 Feb 2013   #8

Microsoft Community Contributor Award Recipient

Windows 8.1 Pro with Media Center
 
 

Quote   Quote: Originally Posted by KeithHoward View Post
Hello gladson1976,
Thanks for your reply. I was able to show folder using "attributes:16[/SIZE][/SIZE]", but, even though I manually in Explorer set a file to read-only, I could not find any read-only files using "attributes:1".
So I remain confused. I am still curious as to how to do this in Explorer, but I just purchased File Locator Pro (recommended by 4wd above), and that solves the problem.
Thanks again to everyone for your responses.
Cheers,
Keith
Of course you did not find it because you used the attribute search wrong, not as Gladson explained. The search attributes:1 finds the files and folders where the Read Only attribute is set but no other attributes. As Windows default is to set Archive attribute on, you should have searched attributes:33 because 1 (Read Only) + 32 (Archive) = 33.

Look here: I set Read Only attribute to one file:

Name:  Attrib_search_1.png
Views: 9
Size:  107.6 KB

Then I search attributes:33 i.e. files with both Archive and Read Only attributes set and of course Windows finds the file:

How to search for Explorer files that are read-only-attrib_search_2.png

Searching attributes:1 gives naturally nothing for I have no files in this folder where only the Read Only attribute is set, all have the Archive attribute on, too:

How to search for Explorer files that are read-only-attrib_search_3.png

OK, let's remove the Archive attribute from this file leaving only the Read Only:

Name:  Attrib_search_4.png
Views: 10
Size:  5.3 KB

And now, naturally, Windows Search finds my file using attributes:1 i.e searching the files and folders where only the Read Only attribute is set, all other attributes turned off:

How to search for Explorer files that are read-only-attrib_search_5.png

You spent money for something that you could easily have done for free with native Windows Search, if you had just read the instructions given to you by Gladson instead of listening someone who very clearly knows next to nothing about Windows Search.

Quote   Quote: Originally Posted by 4wd View Post
The search in (the excellent) Freecommander filemanager does the job.
For paid programs, try FileLocator Pro.

Hope this helps (and, am awaiting the usual flak for recommending anything else than the built-in Windows 7 search).
I find these comments of yours really obnoxious and repulsive. Every time, every thread when we are talking about Search you come and show your total lack of knowledge and give misleading information. This time it went so far that the OP spend money on a third party toy because of your "expertise".

A gentleman would contact OP now to compensate costs caused by his misleading advice.

Kari


My System SpecsSystem Spec
15 Feb 2013   #9

Windows 8 Core X64
 
 

Since I contributed to the "Nope, can't do that" slant, let me say in my own defense that I have never, ever seen any mention of the use of the attribute: search argument in explorer and I spend a lot of time on various forums reading and trying to help.

Google searches also did not turn up any useful suggestions.

So ... many thanks for an eye opening post. Time to do some research.

Thanks Kari and gladson1976, apologies Keith
My System SpecsSystem Spec
15 Feb 2013   #10

Microsoft Community Contributor Award Recipient

Windows 8.1 Pro with Media Center
 
 

From my part, you are welcome .
My System SpecsSystem Spec
Reply

 How to search for Explorer files that are read-only




Thread Tools




Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 09:00 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33