Looking for text inside files does not work at all

  • Thread starter Thread starter Andreas Eibach
  • Start date Start date
A

Andreas Eibach

Well do you guys have an idea what "grep" is?
Yes it comes from the *NIX world but is also known beyond ... looking
for an ascii text string in a file.

I'm really desperate now, as this simply does not work on either WinXP
nor Server 2003, but did (and still does) in my old Win2000! I even
retested to be absolutely sure, and yes it works.
It's really annoying if I really need this stuff and have no 3rd-party
tools handy (like UltraEdit) that I have to dual-boot into my old 2000!
The strings appear in plain ascii and are human readable when
hex-editing them, so Windows _ought_ to find them!

But it did not, so I began to investigate a little more...

Let's have a file as an example which you all should have:
\Program Files\Common Files\Microsoft Shared\Speech\SAPI.DLL

Hex-editing the file reveals that there is a string called "reloc" right
at the beginning of the file.
So if text search (aka grep) worked, this should work too shouldn't it?
But it definitely does NOT.
It seems that Microsoft have indeed made a major error here. The second
field (captioned "A word of phrase in the file:") works almost the same
as the uppermost one.

A test:

- I make sure that the option "look in sub-directories" is activated
- I set the "Look in:" directory to
\Program Files\Common Files\Microsoft Shared\Speech\
- Now I input 'cpl' into the field in the middle.
=> I will get two results: sapi.CPL and spCPLui.dll in the 1033
sub-directory.

And now it comes:
I change the term in the _middle_ input field to 'pi.cpl'.
Now the only result I get is sa[pi.cpl] because it matches with
'pi.cpl'.

But wouldn't you expect this middle field is for looking INSIDE the
files, i. e. in the binary code?
That's how it worked in Windows 2000. And apparently this doesn't work
anymore.
Or if, please tell me how. I re-edited the sapi.dll with a hex editor
and the filename was NOT contained inside the binary code of the file.
So it seems Windows wrongly looked for a match in the file _name_, but
not in the file _contents_ (as it should).

The "reloc" string was successfully found in sapi.dll with a 3rd-party
tool, UltraEdit32. ("Search in Files").

-Andreas
 
In JS had this to say:

My reply is at the bottom of your sent message:
Yep used grep before and Windows search is definitely not grep and no
sed. See Wingrep: http://www.wingrep.com/

JS

Thank heavens someone recommended GREP. Though there are some decent Windows
utilities now for searching and GREP doesn't seem (I've not dug out
substantiating evidence other then my own findings) to work nearly as well
on Windows, not even Windows Grep or WINGREP, etc... It's lighter and
doesn't index (that does make the searching slower) then stuff like the new
Windows Desktop Search (which does search within files of all sorts of types
and I want - very much - to like it, but it's so bloated and nasty and the
interface is an abomination and, wow, I could go on... There goes my
MVP... - not really - if I couldn't speak my mind I'd have declined the
award years ago) but it just doesn't seem as good at finding stuff in files.

*sighs* I wish it would.

However, in this case, polling data from a DLL might be do-able via GREP.
It's certainly not via the common search utilities such as WDS or the Google
offering. So, if it is, would you do me a favor (if you don't mind) and let
me know how it turns out?

--
Galen - MS MVP - Windows (Shell/User & IE)
http://dts-l.org/ http://kgiii.info/

"Chance has put in our way a most singular and whimsical problem, and
its solution is its own reward." - Sherlock Holmes
 
JS said:
Yep used grep before and Windows search is definitely not grep and no
sed.
See Wingrep: http://www.wingrep.com/
OK, but Win2000 had basic functionality and worked for lots of my binary
files.

With XP/2003, this functionality seems to have been completely
streamlined to the max. :-(
I'm only wondering why.

-Andreas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top