Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

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

Jan
10
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.
 
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
 
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
2K
Back
Top