windows – How to list all files in directory/subdirectory without path name CMD? – Stack Overflow
Posted by jpluimers on 2018/07/30
I needed all .dproj
files in all subdirectories, but only their filenames without any directory names.
With directory names, this is easy:
dir /s /b *.dproj
The answers at [WayBack] windows – How to list all files in directory/subdirectory without path name CMD? – Stack Overflow give the below kind of output.
[WayBack] forfiles
embeds all filenames within quotes:
forfiles /m *.dproj /s "Foo.dproj" "Bar.dproj"
A more convoluted [WayBack] for
loop gives them without quotes where n
stands for name
and x
for extension
including .
:
for /r %a in (*.dproj) do @echo %~nxa Foo.dproj Bar.dproj
–jeroen
Leave a Reply