Listing the paths of all directories of a given name

May 20, 2008
3,515
4
Elkridge, MD, USA
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
4,423
85
Albuquerque, NM
prospero.unm.edu
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
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[]
 
May 20, 2008
3,515
4
Elkridge, MD, USA
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
 
May 20, 2008
3,515
4
Elkridge, MD, USA
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
 
Similar threads
Thread starter Title Forum Replies Date
x13 Problem listing repository files using DIR http(s)://... Support 8
samintz How to? DIR listing for exact match Support 1
S WAD PDIR: files with percent sign % in name cause not listing other files in directory Support 9
C Directory listing that shows NTFS file descriptions? Support 3
nickles Neat listing Support 9
mikea Listing "@clip:" Support 1
R Colored directory listing bug with pdir. Support 1
R Listing files in a subfolder Support 1
J Paths shown in DIR /B Support 2
J How to? Disable unix-style paths interpretation of / Support 2
M Incorrect ARGV1 when using linux-style paths Support 4
mfarah How to? Getting pdir to display relative paths. Support 2
R Fixed Using %~dp1 for paths with unavailable drives Support 6
T Paths in ZIP Support 1
S blanks in environment variable paths Support 4
L File completion window saws long paths Support 3
Juanma Barranquero App Paths of type REG_EXPAND_SZ Support 2
gworley Virtual network drive filename completion doesn’t get directories Support 0
thorntonpg sync /S /F creating empty directories Support 5
WadeHatler pdir broken in 19.1 for directories with spaces Support 1
P Color directories in Win10 build 10586 console Support 11
R How to? Name completion only of directories? Support 3
fromano How to? Everything finding directories with 2 or more files in them Support 3
M Problem with Extended Search and non-ASCII characters in directories names Support 3
R How to? Is there a way to see current directories in all drives? Support 11
M . and .. directories counted by @files function Support 5
J rmdir /s recurses into symlinkd directories Support 4
D ffind and directories Support 2
thedave Newly created directories missing from TCMD Support 0
S GPF after successfully renaming directories on an ftp server Support 2
nikbackm Sorting (DIR) over sub-directories Support 3
p.f.moore Compare 2 directories Support 8
S DEL unhides directories Support 9

Similar threads