How do I search through the directory and sub dirs for a string?

BILL Carlisle
BILL Carlisle used Ask the Experts™
on
Hi,
Windows XP Professional search doesn't seem to work.
I put a string that "is" in a file in the "A word or a phrase in the file" and it doesn't show it. Sometimes it does work and most it does not.

Why?

How else can I  search through the directory and sub dirs for a string?
What about DOS commands?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2011
Top Expert 2015
Commented:
Have you tried:
findstr /S /C:"A word or a phrase in the file" C:\some\parent\directory

Open in new window

Most Valuable Expert 2011
Top Expert 2011
Commented:
Try this...
start>run>c:\windows\system32\ciadv.msc

Click on Action>Properties>and under the Generation Tab, check "Index Files with Unknown extensions".

Then rt. click System>properties, and then under the Tracking and Generation Tabs, make sure the Inherit from Service is checked...

Windows Indexer doesnt search all file extensions by default.....

This should fix the Windows GUI search.....
Hi bcarlis

Windows XP's search SHOULD be able to find your string in any file, but only if you tell it what to search. See attached screenshot for suggested settings to find the string "bazonka" in any file type in all folders and sub-folders on the C:\ drive, whether they are hidden or system folders and files.

It should work whether or not you have the Windows Indexing Service enabled or disabled, subject to the good advice from johnb6767 regarding this aspect.  My preference is disabled because I have never noticed any difference in search results, but my perception is that the service slows my systems down a bit in general.

It may also help if you use the Tools > Folder Options > View tab and tell Windows to:
1. Display the contents of System Folders
2. Show Hidden Files and Folders

Search-For-Text-In-Files.jpg
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Most Valuable Expert 2011
Top Expert 2011

Commented:
Agreed on  the Indexing Service being disabled...Resource Hog....

However, with that said, even if it is disabled, XP does not search non standard file extensions (common in the event you are a coder/programmer of some sort) with out enabling the searching of files with Unknown Extensions....
BILL CarlisleAPEX Developer

Author

Commented:
I just noticed that it is CASE sensitive... how do I chose one way or the other?
What are you referring to, the normal Windows search, or to the FINDSTR command?

Type    FINDSTR /?   and it will show you the options.  The one you need is:
/I         Specifies that the search is not to be case-sensitive.

So, using kaufmed's example command:
findstr /S /C:"A word or a phrase in the file" C:\some\parent\directory
is case-sensitive
findstr /I /S /C:"A word or a phrase in the file" C:\some\parent\directory
is NOT case-sensitive

Windows Search?: There is a check-box as shown in the above screenshot.

If that's not what you are referring to, then could you please explain what you do mean.
BILL CarlisleAPEX Developer

Author

Commented:
Oh wow! I space on the checkbox, I thought I looked, I could have swore I looked but there it is... wow!

Thanks, for both examples...
BILL CarlisleAPEX Developer

Author

Commented:
Thanks for the help!
Thank you bcarlis

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial