Windows 7 search problem

Posted on 2012-08-17
Last Modified: 2012-08-20
I am trying to find ".reg" in .cpp files on a windows 7 x64 system.  It does not matter if I use quotes or not, it finds files that have the .reg extension, and .cpp files that have "reg" in the contents, but not ".reg".  This happens if I search using he explorer search box, or from Start.  How can I get this search done correctly?
Question by:eelou
    LVL 37

    Accepted Solution

    Don't know how to solve this in W7 search but from a cmd prompt you can do this:
    findstr /s /m "\.reg" *.cpp

    Open in new window

    This will search your current directory and subdirectories for occurrences of .reg and print just the filename if found.
    LVL 12

    Expert Comment

    Is .reg part of the file name, or part of the text inside the file?  If it's part of the file name, then you can use this to search for it: *.reg*.cpp
    LVL 37

    Expert Comment

    by:Gerwin Jansen
    @seaton007 - asker talks about contents :)
    LVL 12

    Expert Comment

    The regular search for *.reg should suffice if it's in the contents of a .cpp file.

    Seaton007 didn't explain the * so I will.

    The * is a placeholder for text/numbers/etc. Putting in the *.reg means the search will look for something.reg.  Where as having it without the star, search just looks for the reg and discards the . so having the * makes it look for the . before the reg.
    LVL 77

    Expert Comment

    by:David Johnson, CD, MVP
    search for '.reg type:.cpp'

    Author Closing Comment

    The accepted solution does the trick (the others do not).  I was hoping to be able to work with the regular Search, but will download and use 'Everything', it is a free tool.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Suggested Solutions

    Title # Comments Views Activity
    Windows 10 couldn't be installed 17 197
    iCloud space usage - IOS 9.3.5, iPhone 6S 2 52
    Can't Find Scheduled Task 10 34
    7-zip 8 15
    A step by step SEO guide to creating content that drives traffic and maximizes page views by using the right tricks, tools and keyword analysis. You are the subject matter expert.   You have forgotten more about your area of expertise than most …
    Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
    This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
    The viewer will learn how to back up with the free utility from runtime software, DriveImageXML using Windows 7. Download DriveImageXML from Open folder where it was saved: Start installation by double clicking the install scrip…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now