The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,184 other subscribers

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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: