Rename folders using Folder Size as a parameter. Much like filesize.

Advanced Renamer forum
#1 : 27/11-24 13:11
Bobby Caesar
Posts: 2
Absolutely loving this tool. How did I survive without it all these years!

Question: as the subject says, I want to include the folder size in the folder name but dont see that as an option. Please help!

I can use external tool (like treesize) to export the folder names and sizes. But not sure how to then use that as feed for Advanced Renamer to rename my folders.

Thank you!
#2 : 28/11-24 09:58
Delta Foxtrot
Posts: 364
Reply to #1:

Hi Bobby, welcome,

See this thread. https://www.advancedrenamer.com/forum_thread?for um_id=15182

You will need to be able (with a spreadsheet?) to create a .csv file with two columns, (1) the original filename; and (2) the foldersize (or the new filename you'd like to replace the old filename with). Whatever, see Miguel's entry in that thread.

Hope this helps!

Best,
DF
#3 : 28/11-24 20:00
Miguel
Posts: 163
Reply to #1:
Hi Bobby,
EDIT 1: Only works in Windows platform.

As Delta Foxtrot says you can create a csv file with 2 columns. This can be very fustrating do it by hand . In my collections of scripts I have one powershell script that create a csv file with the size an the name of the folders: The script must be executed from a PowerShell window. You must be in the folder wich contain the folders to list.

EDIT2: In Windows Explorer navigate where your folders are. Right click and select "Open Powershell here". If this option does not appear write "powershell" in the address bar.
Copy the script and paste in the Powershell window.

Here it is:
--------------
$ConfirmPreference = 'None'
$fso = New-Object -ComObject Scripting.FileSystemObject
$folders = Get-ChildItem -Directory | ForEach-Object {
$size = $fso.GetFolder($_.FullName).Size
[PSCustomObject]@{
'Size [MB]' = '{0:N2}' -f ($size / 1MB)
FolderName = $_.Name
}
} | Sort-Object FolderName

$folders | Export-Csv -Path "folders_size.csv" -Delimiter ';' -NoTypeInformation -Force

-----------------------------
It create a csv file named "folders_size.csv" sorted alphabetically and separated by a semicolon. Ready for use with Aren.
Once created the csv file select all the folders and drag them into Aren. Check "Add folder" and "add root folder" unchek "add subfolders". The script does no work with subfolders.

Press Import->Data from CSV
Now you can create a New Name method. Somethig like this:
<Name> - Size (<Csv:1>Mb)
This will give a result like this:
Folder Name - Size (200Mb)

EDIT3: Also can use <csv:2> instead of <Name> tag.

PS. Unfortunately this script isn´t from my creation. Was downloaded time ago from somewhere.

Miguel


edited: 29/11-24 11:58
#4 : 29/11-24 20:56
Bobby Caesar
Posts: 2
Reply to #3:
Thank you DF, and Miguel.
Its not something I am going to do often. So I am cool, as long as there is an automated way.

Thanks again guys.

-Bobby