This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Listing all directories from a given root in batch file  RSS feed

 
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
Boost this thread!