`for` loop of Microsoft `cmd`: how can I process only the files with a certain extension?
- by uvts_cvs
I have a the folder c:\test\ and two files in it a.txt and b.txtv.
I would like to process just the files with extension equal to .txt.
If I write this commands
cd c:\test
for %f in (*.txt) do echo %f
I will get the result where both a.txt and b.txtv are listed.
The same happens with
cd c:\test
dir *.txt
It seems .txt is the same of .txtv.
I have Windows XP SP3 in Italian and the result of
ver
is Microsoft Windows XP [Versione 5.1.2600].
The same result is from Windows 7 in English Microsoft Windows XP [Version 6.1.7601].