Listing the paths of all directories of a given name

#1
Many of my directories have subdirectories of a specific name, e.g., BACKUP.
It may be a brain freeze, but I could not find a combination of option
switches and command parameters for DIR, FFIND or PDIR to list just the
directories named BACKUP (with full pathname), and ignore their contents.
Suggestions welcome!
--
Steve
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,602
46
Albuquerque, NM
prospero.unm.edu
#2
Many of my directories have subdirectories of a specific name, e.g., BACKUP.
It may be a brain freeze, but I could not find a combination of option
switches and command parameters for DIR, FFIND or PDIR to list just the
directories named BACKUP (with full pathname), and ignore their contents.
Perhaps something like:
Code:
dir c:\backup[] /a:d /s /b
(The brackets make it a wildspec, without introducing the possibility of matching anything else besides BACKUP.)
 
May 29, 2008
36
0
#3
Steve Fábián wrote:

> Many of my directories have subdirectories of a specific name, e.g., BACKUP.
> It may be a brain freeze, but I could not find a combination of option
> switches and command parameters for DIR, FFIND or PDIR to list just the
> directories named BACKUP (with full pathname), and ignore their contents.
> Suggestions welcome!
I use this to find all temp directories on all drives:
ffind /msba:d /d%@strip[ :,%_hdrives] temp[]
 
#4
Charles Dye wrote:
| ---Quote (Originally by Steve Fabian)---
|| Many of my directories have subdirectories of a specific name, e.g.,
|| BACKUP. It may be a brain freeze, but I could not find a combination of
|| option switches and command parameters for DIR, FFIND or PDIR to list
just
|| the directories named BACKUP (with full pathname), and ignore their
|| contents.
| ---End Quote---
| Perhaps something like:
| Code:
| ---------
| dir c:\backup[] /a:d /s /b
| ---------
| (The brackets make it a wildspec, without introducing the
| possibility of matching anything else besides BACKUP.)

Thanks, it works as hoped for. I just did not think of using wildcards to
force the parser to interpret the command parameter differently, when
wildcards are not needed to specify the directory name.
--
Steve
 
#5
dbartt wrote:
...
| I use this to find all temp directories on all drives:
| ffind /msba:d /d%@strip[ :,%_hdrives] temp[]

Thanks, the idea is the same as in Charles' - the use of a fake wildcard to
alter parser behavior. The use of @strip is ingenious!
--
Steve