How to? Set the descript.ion for a folder to a comma-delimited list of its subfolders?

Jan 7, 2022
9
0
I have a small collection of monthly folders where the subfolders are topics discussed during that month. I'd like to set the initial description of each parent folder to a comma-delimited list of all its subfolders. Can anyone help me with this? TIA.
 
May 20, 2008
11,840
120
Syracuse, NY, USA
I don't use descriptions. Making the list is fairly easy. Below I have excluded hidden and system subdirectories.

Code:
v:\> type subdirlist.btm
setlocal
cdd %1
unset subdirlist
do subdir in /a:+d-s-h *
    set subdirlist=%[subdirlist]%subdir,
enddo
set subdirlist=%@rtrim[",",%subdirlist]
echo subdirectory list for %1 is^r^n^r^n%subdirlist
cdd -

v:\> subdirlist.btm v:\
subdirectory list for v:\ is

a b,eshelp,from_barnyard,hold,ipreg,junk,LocalDumps,plugins,s2g,test,tweakstuff,wt_schemes
 
Jan 7, 2022
9
0
Brilliant! Thanks @vefatica

My final file is:

Code:
setlocal
cdd %1
unset subdirlist
do subdir in /a:+d-s-h *
    set subdirlist=%[subdirlist]%subdir,
enddo
set subdirlist=%@rtrim[",",%subdirlist]
cdd -
DESCRIBE %1 /D"%subdirlist"

And the command to do everything in a (yearly) folder at once is:

Code:
for /d %x in (#*) do ..\desc-sub.btm "%x"

Attempting to attach the result...
2022-02-03_07-46-00.png
 

Similar threads

Replies
4
Views
1K