Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Listing all directories from a given root in batch file

 
Garrett Rowe
Ranch Hand
Posts: 1296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I list all directories from a batch file from a given root path. Ideally I'd like to list the full path to the directory, equivalent to this Java code



The last thing I came up with was:

Which does list all the directories given a starting directory, but it just list the directory name, not the path
 
Garrett Rowe
Ranch Hand
Posts: 1296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so I found one way using the %CD% "pseudovariable" that gives the current directory



I'd imagine that there is an easier way than this, but I haven't figured it out yet.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic