Author Topic: Windows 7 Search file contents  (Read 5453 times)

Ryan

  • Guest
Windows 7 Search file contents
« on: August 08, 2012, 12:14:48 AM »
Hi all,

I'm trying to find a way to get Windows 7 to search file contents regardless of the file extension.  A little background might help.  The family business has some old CNC programs, most of which were started in the 80s.  A lot of the part numbers that we used as filenames would be 8 characters or more.  (For those not familiar, I'm alluding to the "8.3" filename limitation in DOS.)  To accommodate the part numbers, the extension would be utilized as part of the number, and it would also be used for subsequent revision codes, so the extensions are meaningless from a Windows standpoint.  I've searched the Internet for ways to search file contents in Windows 7, but it seems impossible without adding the extensions (dozens) to a master list in Windows.  I've already tried the "Always search file names and contents" option under Folder Options->Search tab.  No effect.

Anyone have any ideas?

Thank you!

Ryan

  • Guest
Re: Windows 7 Search file contents
« Reply #1 on: August 08, 2012, 01:16:53 AM »
After a little more investigation, I realized that this is not something specific to Windows 7.  I tried doing the search in XP with the same lack of results.

FORTRANS

  • Member
  • *****
  • Posts: 1238
Re: Windows 7 Search file contents
« Reply #2 on: August 08, 2012, 01:47:31 AM »
Hi,

   You could try wildcards.  ????????.???

Regards,

Steve

jj2007

  • Member
  • *****
  • Posts: 13958
  • Assembly is fun ;-)
    • MasmBasic
Re: Windows 7 Search file contents
« Reply #3 on: August 08, 2012, 02:37:46 AM »
If wildcards fail, try to write a proggie...

include \masm32\MasmBasic\MasmBasic.inc   ; download
  Init
  GetFiles \Masm32\*   ; load all filenames into the Files$() array
  SortFiles      ; sort by date, oldest last
  push eax      ; file count on stack
  xor ecx, ecx
  PrintLine 'Files containing the word "WndProc:"'
  PrintLine "#", Tb$, "Size", Tb$, "Date       ", Tb$, "File"
  MaxSize =   20000   ; 20 k
  MinHours =   100000   ; 12 years
  .Repeat
   .if GfSize(ecx)<MaxSize        ; skip big files
      .if GfAgeHours(ecx)>MinHours     ; skip recent files
         mov esi, Files$(ecx)
         .if !Instr_(esi, ".exe", 1)        ; skip executables
            .if !Instr_(esi, ".zip", 1)        ; skip archives
               Let edi=FileRead$(esi)
               .if Instr_(edi, "WndProc", 1+4)   ; WndProc can be any string, in quotes, as offset, in a register etc
                  PrintLine Str$("%i\t", ecx), Str$(GfSize(ecx)), Tb$, GfDate$(ecx), Spc2$, Tb$, Mid$(esi, Rinstr(esi, "\")+1)
               .endif
            .endif
         .endif
      .endif
   .endif
   inc ecx
  .Until ecx>=stack
  pop eax
  Inkey "ok"
  Exit
end start

Output:

Files containing the word "WndProc:"
#       Size    Date            File
15394   19219   16.2.01         richedit.asm
15495   8712    25.12.00        dialogs.asm
...
15890   6561    12.4.99         oldstyle.asm
15901   13798   27.1.99         generic.asm
15907   6792    21.1.99         calldll.asm
15908   6560    21.1.99         loaddll.asm


Source attached, tested on Win7-32.

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: Windows 7 Search file contents
« Reply #4 on: August 08, 2012, 03:15:25 AM »
you can disable indexing, as i recall
you might google something like "explorer file search disable indexing"

all in all, you are better off to use a 3rd party program
i use Agent Ransack
http://www.mythicsoft.com/page.aspx?type=agentransack&page=home

Ryan

  • Guest
Re: Windows 7 Search file contents
« Reply #5 on: August 08, 2012, 03:26:41 AM »
We were able to find what we needed.  I think if it really becomes an issue, I'll just write a quick program to put a .txt extension on all the files so they're uniform and Windows will see them for what they are.

Farabi

  • Member
  • ****
  • Posts: 968
  • Neuroscience Fans
Re: Windows 7 Search file contents
« Reply #6 on: August 11, 2012, 03:38:58 PM »
Im still prefer my XP. It is still faster than 7. Im downgrading it and waste my 30 USD.
http://farabidatacenter.url.ph/MySoftware/
My 3D Game Engine Demo.

Contact me at Whatsapp: 6283818314165