Append to Folder name integer number of files it contains

Bulk Rename Utility How-To's

Append to Folder name integer number of files it contains

Postby Noteworthy » Sat Jun 11, 2022 10:12 am

The subject line says it all:
How to append to a Folder name the integer number of files it contains.

For example, if a folder contains 17 music files and the folder name is "Lennon, John" then the folder name should read Lennon, John (17).

I tried unsuccesfully to find whether such a question has already been answered.

Many thanks
Noteworthy
 
Posts: 7
Joined: Mon Jun 22, 2020 3:13 pm

Append (#Files) to folder-name

Postby Luuk » Mon Jun 13, 2022 9:10 pm

The bru will never look at another file or folder, while its renaming any file or folder-name.
If its me, Im just open a command prompt at the main folder, and then type a long command like...
For /f "delims=" %A in ('dir /b /s /ad^|sort /r') do @For /f "delims=" %B in ('dir /b /a-d 2^>nul "%A" ^|find /v /c ":"') do @echo "%A" "%~nA (%B)"

This presents to the screen like... "C:\Some\Folder\Path\FolderName" "NewFolderName (#)"
If satisfied with NewFolderNames (#), then change @echo ===> @ren to conduct the folder-renames.
Luuk
 
Posts: 689
Joined: Fri Feb 21, 2020 10:58 pm


Return to How-To