Timeline for excluding certain file extensions in Windows search
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 12, 2017 at 16:59 | vote | accept | tuskiomi | ||
Jun 12, 2017 at 10:18 | comment | added | phuclv | another duplicate: Windows command line search for exact extension with dir | |
Jun 12, 2017 at 10:18 | comment | added | AFH |
@LưuVĩnhPhúc - Point taken. All I can add is that for a cmd user TCC is a lot easier to learn than PowerShell.
|
|
Jun 12, 2017 at 10:13 | comment | added | phuclv |
@AFH It's exactly the reason cmd cannot remove those features because 32-bit Windows 7 and 8 can still run 16-bit programs. Old batch scripts also rely on those behavior, like dir *.txt being exactly the same as dir .txt so MS can't remove them from 64-bit cmd either. Moreover you don't need any replacement, powershell can do all of that and match Unix behavior. Simply abandon cmd altogether
|
|
Jun 12, 2017 at 10:11 | comment | added | AFH |
@LưuVĩnhPhúc - Your links explain the mechanism, but not the reason for it, especially now that Windows 10 appears not to support 16-bit programs. There is another solution: TCC/LE is a replacement for cmd , which is extended to give near-Unix scripting power, but more or less maintains cmd compatibility for existing scripts; by default its dir command does not match 8.3 names, though there is an option to allow this. TCC/LE is free for non-commercial use, and is a slightly stripped-down version of the even more powerful TCC.
|
|
Jun 12, 2017 at 2:33 | comment | added | phuclv | @AFH dir command matchs both short and long names for a reason. Why does FindFirstFile find short names? | |
Jun 11, 2017 at 22:53 | comment | added | AFH |
I'm sorry, you're right, and I've just realised why: Windows still insists on providing 8.3 names for long file names, including those with long extensions. Unfortunately all the name massaging is done in the 8-character part and the 3-character extension is the first 3 characters of the long extension. In its wisdom dir matches both long and short file names, hence your result. You can disable 8.3 names or you can use findstr to filter the results (as I now see David Postill has suggested in his answer).
|
|
Jun 11, 2017 at 22:52 | answer | added | DavidPostill♦ | timeline score: 2 | |
Jun 11, 2017 at 22:26 | comment | added | tuskiomi | @AFH this search still yields .properties, .providers, and .project files. | |
Jun 11, 2017 at 22:22 | comment | added | AFH |
If you use cmd and dir *.pro /s you will find the results you want, though maybe not in the format you might have wanted them.
|
|
Jun 11, 2017 at 22:19 | history | asked | tuskiomi | CC BY-SA 3.0 |