Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: How to find a file with the exact name?

14 Nov 2010   #21
WindowsStar

Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
 
 

Ok here is the solution:

Open Command Prompt (Seems to work elevated or not, my sample is elevated)

See the screen shot: (First a DIR A for just the file on the root, then a DIR A /S to search the entire drive)




Attached Thumbnails
How to find a file with the exact name?-searchaonly.jpg  
My System SpecsSystem Spec
.
14 Nov 2010   #22
Trucidation

 

Quote   Quote: Originally Posted by WindowsStar View Post
(First a DIR A for just the file on the root, then a DIR A /S to search the entire drive)
Yeah, I used to regularly use the /s/b/p switch combo and pipe the output to a text file, because we have these custom programs that would throw near-identical logs all over the damn file hierarchy. The search feature has improved though and I've weaned myself from resorting to the command prompt. Mostly.

Quote   Quote: Originally Posted by gilmoses View Post
It looks to me just like a simple deficiency in Windows 7 implementation...
No Microsoft moderator here to defend Win 7?
What is there to defend against? Piss-poor file naming practice? The long filename system was created for a reason. The fact the system even allows you to create single character filenames should be a bonus. Should we complain password generators don't allow passwords 3 characters or shorter?

We used to have directories full of 2-character name files. "7a", "3f", "D!". Things improved tremendously when we managed to kludge a script which grovels through these files and rename them according to the department and date (because nobody has the source to the original program which was probably written in hieroglyphs, and we'd really not touch something running on production-line machines).

mborner put into words what I like about the search. There may be unrelated results but when yours appears on top, who cares about the rest?
My System SpecsSystem Spec
15 Nov 2010   #23
Dzomlija

Windows 7 Ultimate x64
 
 

I've been thinking about this one for a bit, and have found what should hopefully be a solution.

Normally, when you search for a file, you would use:

How to find a file with the exact name?-image1.jpg
filename:file

to return results whose filename contains the word "file". To match files that are named "file", you would use:

How to find a file with the exact name?-image2.jpg
filename:"file"

If you want to limit the results to a particular file type, then you will add the "ext:" query:

How to find a file with the exact name?-image3.jpg
filename:file ext:txt

But how to search for filenames that have no extension? Just use the Windows Search "empty string" indicator of two square brackets:

How to find a file with the exact name?-image4.jpg
filename:file ext:[]

Note that the "[]" empty string indicator works for other properties also, such as "tag", "title", etc...


My System SpecsSystem Spec
.

15 Nov 2010   #24
Kari

 

I can not understand I didn't think of that! You nailed it.

Bowing in front of The Real Guru. Rep given

Kari



EDIT, a few minutes later: Tested it and there's still something missing. It really finds all files where filename includes "file" and no extension. But what if you really want to find only file "file", not "file1" and "file2" and "ThisFile"? As already agreed in this thread, it's not so important because using this solution of yours the file "file" is at the top of search results, but out of interest: how to get only the file "file"?

(Could I ask this in a more confusing way? )
My System SpecsSystem Spec
15 Nov 2010   #25
Dzomlija

Windows 7 Ultimate x64
 
 

Quote   Quote: Originally Posted by Kari View Post
I can not understand I didn't think of that! You nailed it.

Bowing in front of The Real Guru. Rep given

Kari



EDIT, a few minutes later: Tested it and there's still something missing. It really finds all files where filename includes "file" and no extension. But what if you really want to find only file "file", not "file1" and "file2" and "ThisFile"? As already agreed in this thread, it's not so important because using this solution of yours the file "file" is at the top of search results, but out of interest: how to get only the file "file"?

(Could I ask this in a more confusing way? )
Using my example of searching for files named "file", with no extension:

How to find a file with the exact name?-image5.jpg
filename:file ext:[]
Returns "file", "file1" and "file2"

How to find a file with the exact name?-image6.jpg
filename:"file" ext:[]
Enclosing the word "file" in quotes filters the results to give only "file"

Thanks for the rep.


My System SpecsSystem Spec
15 Nov 2010   #26
Kari

 

Second miss for me tonight. Forgot the quotes. Mods please remove half of my rep
My System SpecsSystem Spec
15 Nov 2010   #27
gilmoses

Windows 7 Professional 64 bit
 
 

Sorry to be a party pooper, but 'filename:"file" ext:[]' doesn't exclude folders, here's what I get:

How to find a file with the exact name?-where-file-4.png

and why weren't the folders with the name 'a' the only ones to appear on this list?

NOW, as to all ponderers on why would I need to create an extensionless file, well... do perform a short search in your own WINDOWS folder for 'ext:[]'. How many extensionless files did you get? I have 707 (not counting folders). And, oh well, it's Microsoft's files, not mine... the question should go to MS

Besides, when a program fail to do what's expected out of it, blaming the user isn't the right attitude... we should make the program work.

Dzomlija, you were the closest. Thanks, if you can help filtering out the folder files you're a king.


My System SpecsSystem Spec
15 Nov 2010   #28
WindowsStar

Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
 
 

Quote   Quote: Originally Posted by Dzomlija View Post
Quote   Quote: Originally Posted by Kari View Post
I can not understand I didn't think of that! You nailed it.

Bowing in front of The Real Guru. Rep given

Kari



EDIT, a few minutes later: Tested it and there's still something missing. It really finds all files where filename includes "file" and no extension. But what if you really want to find only file "file", not "file1" and "file2" and "ThisFile"? As already agreed in this thread, it's not so important because using this solution of yours the file "file" is at the top of search results, but out of interest: how to get only the file "file"?

(Could I ask this in a more confusing way? )
Using my example of searching for files named "file", with no extension:

Attachment 114326
filename:file ext:[]
Returns "file", "file1" and "file2"

Attachment 114327
filename:"file" ext:[]
Enclosing the word "file" in quotes filters the results to give only "file"

Thanks for the rep.
I tried it here. It does not work. However the Command Prompt works everytime.
My System SpecsSystem Spec
15 Nov 2010   #29
Dzomlija

Windows 7 Ultimate x64
 
 

Quote   Quote: Originally Posted by gilmoses View Post
Sorry to be a party pooper, but 'filename:"file" ext:[]' doesn't exclude folders, here's what I get:

Attachment 114365

and why weren't the folders with the name 'a' the only ones to appear on this list?

NOW, as to all ponderers on why would I need to create an extensionless file, well... do perform a short search in your own WINDOWS folder for 'ext:[]'. How many extensionless files did you get? I have 707 (not counting folders). And, oh well, it's Microsoft's files, not mine... the question should go to MS

Besides, when a program fail to do what's expected out of it, blaming the user isn't the right attitude... we should make the program work.

Dzomlija, you were the closest. Thanks, if you can help filtering out the folder files you're a king.
How to find a file with the exact name?-image7.jpg
filename:"file" ext:[]
Return results that include folders, which is what you do not want, so:

How to find a file with the exact name?-image8.jpg
filename:"file" ext:[] NOT kind:folder
Excludes folders from the search.

I think also to make it a little easier on you, you might want to have a look at the Advanced Searches Tutorial of mine on the Vista forums. It covers much of what I have been discussing with you.

You can also look at the Microsoft reference for Windows Search Advanced Query Syntax and Tips and Tricks.

In hindsight, perhaps I should have referred you to said tutorial and reference from the start....


My System SpecsSystem Spec
15 Nov 2010   #30
WindowsStar

Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
 
 

Ok this does work:

filename:"a" ext:[] NOT kind:folder

I only get the file named: "a"

Awesome!
My System SpecsSystem Spec
Reply

 How to find a file with the exact name?




Thread Tools




Similar help and support threads
Thread Forum
Windows can't find the file when trying to run a .bat file
When I double click a .bat file windows says it can't find it, but if I do a direct access to the file then it runs it without any problem. Any idea? Tanks!
General Discussion
Which File? (The system cannot find the file specified)
I have a Windows 7 driver installation question that has been nagging me for awhile. I now turn to the forums for help. If I try to install a driver and not all of the driver files are present, I will get the error message "The system cannot find the file specified." But the problem is that it...
Drivers
How do I find which file is damaged?
I did a error scan with HD Tune Pro on a 2TB WDEADS20 and it says that error at 63248 MB. The health status says I have 16 unstable sectors. How can I find which file is damaged before backing up my files to another drive?
Hardware & Devices
Can't find a file
Hey Guys, So, I did something kind of silly and I'm hoping that one of you can help me out. A friend sent me an attachment word document in my gmail. I clicked "Download" and when promped by IE to "Open" or "Save", I clicked "Open" and proceeded to make a lot of edits to the file. When I...
Microsoft Office
File Transfer Dialogue: Exact Time
Hello, I've noticed since my upgrade to Windows 7 that when a file transfer dialogue is going, I'll see the dilaogue populate "Time Remaining: About 45 minutes" for example. Is there a way to get windows to display the exact calculated time, rather than "about x minutes"?
General Discussion
Can't find the FSX.CFG file
Does anyone know how to find the fsx.cfg file for FSX in Windows 7. I have tried to search for it and it is no where to be found. It's not in the same place as vista. I have installed FSX in it's own partition.
Gaming


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 21:24.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App