0

I'm trying to use the Windows 7 search to look for a file name within a file like this:

content:"reports.asp"

Instead of getting just files that contains "reports.asp" I am also getting files that contains "reports". I have also tried this because I thought I have to escape the character:

content:"reports\.asp"

How can I modify my search so that I am only getting files that contains "reports.asp"?

[UPDATE] I have checked Trouble trying to use Windows Search to search for file with a question mark in the content and it appears that it did not help me. I have tried using the suggestion as follows:

content:"reports~=.asp"

But I get the same result as if I just used my first search parameters.

John Odom
  • 123
  • 9

2 Answers2

1

It would be easier to use file commander for this, for example Total Commander. You can search then in selected files, within them and archives like rar, zip etc. inside. You can even search for a particular regular expression then!

pbies
  • 2,757
  • 3
  • 21
  • 23
  • Thanks for the answer, but I would prefer a solution that does not require me to download anything since I'm not allowed to download/install anything myself on this PC. – John Odom Nov 24 '14 at 17:34
  • 1
    Then you can use cmd.exe and tools provided as 'find' and 'for'. – pbies Nov 24 '14 at 17:35
1

EDIT:

Using the FIND command in CMD

Ended up solving the problem using FIND.

FIND /I "reports.asp" C:\Approximate location of file\*

*Note that you must include the asterisk * as you are searching for a file not folder. Failing to do so will yield an Access is Denied error.

The method below is for searches not wanting to find content inside files (so only for file names)

Open Folder Options by going into Control Panel, clicking Appearance and Personalization, and then clicking Folder Options (or any of the numerous other ways to get there).

enter image description here

Under the Search tab, disable Find Partial Matches. This should fix your problem.

enter image description here

Rsya Studios
  • 3,626
  • 2
  • 17
  • 25
  • It did not help :(. I'm still getting files that are not including reports.asp but are including reports or asp. – John Odom Nov 24 '14 at 22:03
  • Have you tried search **without** `content:`? Using that searches inside files. http://superuser.com/questions/60173/how-to-search-inside-files-on-windows-7 – Rsya Studios Nov 24 '14 at 22:10
  • I want to search for a file name within files so I need to use `content:`, unless there is something else that I can use. Just searching for reports.asp returns the reports.asp which is what I do not want. – John Odom Nov 24 '14 at 22:13
  • @JohnOdom do you know the file type of the file? And is this a one-time search? – Rsya Studios Nov 24 '14 at 22:19
  • I do not know the file types of the files that may contain that string, and it is a one-time search. I wanted to search for it so that I would not have to open up each file manually to look for files that reference reports.asp. – John Odom Nov 24 '14 at 22:25
  • Just an idea, what happens if you put `content: ""reports.asp""`? – Rsya Studios Nov 24 '14 at 22:32
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/18943/discussion-between-john-odom-and-rsya-studios). – John Odom Nov 24 '14 at 22:33
  • Thanks for the help! I'm going to be using this more when I need to look for file references in an unknown directory :). – John Odom Nov 25 '14 at 15:58