More on search hell

Page 1 of 6 123 ... LastLast

  1. Posts : 23
    Windows 7 Professional 64 bit
       #1

    More on search hell


    Hi,

    I'm back with another frustrating search problem:
    How to find a file by a string in the middle of the filename?

    E.g. I'm searching for files with "Persist" in their name, in C:\Windows:

    filename:Persist

    10 items are found, but not this one:
    "CbsPersist_20101012145040.cab" (in my C:\Windows\Logs)

    That's because "Persist" does not start the filename, and is not after a dot or a hyphen.
    I've tried looking in the advanced syntax for search but to no avail.

    This is of course an example, I have dozens of log files with a similar naming convention (capital letter for each word start, LikeThisForExample) from which I must find a file.

    Please help,

    Thanks,
    Gil.
      My Computer


  2. Posts : 5,605
    Originally Win 7 Hm Prem x64 Ver 6.1.7600 Build 7601-SP1 | Upgraded to Windows 10 December 14, 2019
       #2

    Hi! gilmoses, welcome to W7F :)

    Just off the top of my head, have you tried *Persist* or %Persist%
      My Computer


  3. Posts : 23
    Windows 7 Professional 64 bit
    Thread Starter
       #3

    Hi Anak,

    Ok, *Persist* found the file. However this is the only way to find it and Windows Help doesn't tell you the file won't be found otherwise.

    Thanks for that!

    Gil.
      My Computer


  4. Posts : 1,261
    Windows 7 Professional 32-bit SP1
       #4

    gilmoses said:
    Hi,

    I'm back with another frustrating search problem:
    How to find a file by a string in the middle of the filename?

    E.g. I'm searching for files with "Persist" in their name, in C:\Windows:

    filename:Persist

    10 items are found, but not this one:
    "CbsPersist_20101012145040.cab" (in my C:\Windows\Logs)

    That's because "Persist" does not start the filename, and is not after a dot or a hyphen.
    I've tried looking in the advanced syntax for search but to no avail.

    This is of course an example, I have dozens of log files with a similar naming convention (capital letter for each word start, LikeThisForExample) from which I must find a file.

    Please help,

    Thanks,
    Gil.
    You can't find those files, because by default the "C:\Windows" folder, and all it's subfolders, are not included in the search index.

    I did a quick test to verify that I had files with "persist" in the filename:
    More on search hell-image1.jpg

    But as you can see, a search in Windows found nothing:
    More on search hell-image2.jpg

    As stated, this is because "C:\Windows" is excluded from the index:
    More on search hell-image3.jpg

    So if you absolutely must find such files, but are not willing to add "C:\Windows" to the index, try this:

    More on search hell-image4.jpg
    1. Open Windows Explorer, and navigate to "C:\Windows"
    2. Make sure that there are no files selected.
    3. Hold down the <SHIFT> key, and right-click an empty part of the list (anything not containing an icon)
    4. Click the "Open command window here" option
    5. A Command Prompt should open to "C:\Windows"
    6. If you only want to search the LOGS folders, type "CD Logs" (without quotes) and press <ENTER>
    7. Type "dir *persist*.* /a /s /p" (without the quotes) and press <ENTER>.
    For more information on the parameters of DIR, type "DIR /?" (without quotes) and press <ENTER>

    Code:
     
    C:\Windows\Logs>dir *persist*.* /a /s /p
     Volume in drive C is Windows 7 Ultimate x64
     Volume Serial Number is 365F-53AD
     Directory of C:\Windows\Logs\CBS
    08/08/2010  16:32           780,937 CbsPersist_20100808161414.cab
    06/10/2010  06:12           612,423 CbsPersist_20101006220117.cab
                   2 File(s)      1,393,360 bytes
         Total Files Listed:
                   2 File(s)      1,393,360 bytes
                   0 Dir(s)  25,829,761,024 bytes free
    C:\Windows\Logs>dir *persist*.* /a /s /p /b
    C:\Windows\Logs\CBS\CbsPersist_20100808161414.cab
    C:\Windows\Logs\CBS\CbsPersist_20101006220117.cab
    C:\Windows\Logs>
    
      My Computer


  5. Posts : 5,605
    Originally Win 7 Hm Prem x64 Ver 6.1.7600 Build 7601-SP1 | Upgraded to Windows 10 December 14, 2019
       #5

    Find any one of differently named files
    Code:
    find . \( -name "*jsp" -o -name "*java" \) -type f -ls

    The -ls option prints extended information, and the example finds any file whose name ends with either 'jsp' or 'java'. Note that the parentheses are required. Also note that the operator "or" can be abbreviated as "o". The "and" operator is assumed where no operator is given. In many shells the parentheses must be escaped with a backslash, "\(" and "\)", to prevent them from being interpreted as special shell characters. The -ls option and the -or operator are not available on all versions of find.
    find - Wiki

    Your word would have to be inserted where jsp and java are.
      My Computer


  6. Posts : 23
    Windows 7 Professional 64 bit
    Thread Starter
       #6

    Dzomlija,
    As Anak had pointed out, you WILL find the file if you specify filename:*persist*.

    I don't think a folder must be indexed in order to find a file there - that would be ridiculous. The search will just be slower.

    Gil.
      My Computer


  7. Posts : 5,605
    Originally Win 7 Hm Prem x64 Ver 6.1.7600 Build 7601-SP1 | Upgraded to Windows 10 December 14, 2019
       #7

    Peter, would the command line work even if the HDD was not Indexed?
      My Computer


  8. Posts : 1,261
    Windows 7 Professional 32-bit SP1
       #8

    Anak said:
    Peter, would the command line work even if the HDD was not Indexed?
    Yes, it would.
      My Computer


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

    Anak said:
    Peter, would the command line work even if the HDD was not Indexed?
    I'm not Peter but please allow me to answer: Yes.

    BTW, there's two ways to use Windows search, searching index only and searching all locations.

    When you search using Start Menu > Search field, you search indexed locations only. Searching from Explorer window's search field searches also non indexed locations from that location and downwards for instance searching in Explorer window for C:\Windows searches C:\Windows and all its subfolders, searching in My Computer window searches the whole computer, searching Explorer window for drive F: searches the whole drive F:.

    Kari
      My Computer


  10. Posts : 1,261
    Windows 7 Professional 32-bit SP1
       #10

    gilmoses said:
    Dzomlija,
    As Anak had pointed out, you WILL find the file if you specify filename:*persist*.

    I don't think a folder must be indexed in order to find a file there - that would be ridiculous. The search will just be slower.

    Gil.
    Sorry 'bout that, I'm a bit daft this morning [HITTING MYSELF ON THE HEAD], and should've remembered the wildcards.
      My Computer


 
Page 1 of 6 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 20:14.
Find Us