How to search for Explorer files that are read-only

Page 1 of 3 123 LastLast

  1. Posts : 15
    Windows 7 Professional x64
       #1

    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 Computer


  2. Posts : 6,285
    Windows 10 Pro X64
       #2

    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 Computer


  3. 4wd
    Posts : 337
    W7, W8.1
       #3

    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 w7 search).
    Attached Thumbnails Attached Thumbnails How to search for Explorer files that are read-only-com-search.jpg  
      My Computer


  4. Posts : 15
    Windows 7 Professional x64
    Thread Starter
       #4

    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 Computer


  5. Posts : 6,285
    Windows 10 Pro X64
       #5

    I don't believe you can do what you want in Windows Explorer. Command Prompt or another app is needed.
      My Computer


  6. Posts : 1,210
    Windows 7 Ultimate x64 (XP, 98SE, 95, 3.11, DOS 7.10 on VM) + Ubuntu 10.04 LTS Lucid Lynx
       #6

    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 Computer


  7. Posts : 15
    Windows 7 Professional x64
    Thread Starter
       #7

    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 Computer


  8. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #8

    KeithHoward said:
    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:

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

    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:

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

    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.

    4wd said:
    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 w7 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 Computer


  9. Posts : 6,285
    Windows 10 Pro X64
       #9

    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 Computer


  10. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #10

    From my part, you are welcome .
      My Computer


 
Page 1 of 3 123 LastLast

  Related Discussions
Our Sites
Site Links
About 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 19:05.
Find Us