Find & Delete Empty Folders

English support forum

Moderators: white, Hacker, petermad, Stefan2

MrMcGoo
Junior Member
Junior Member
Posts: 32
Joined: 2006-08-29, 01:44 UTC

Find & Delete Empty Folders

Post by *MrMcGoo »

There are free programs that do this, but is there any way to find empty folders and subfolders within TC so they can be deleted?

Thanks. :!:
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2MrMcGoo

try plugin DirSizeCalc and search. http://www.freeimagehosting.net/6kkdz
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
MrMcGoo
Junior Member
Junior Member
Posts: 32
Joined: 2006-08-29, 01:44 UTC

Post by *MrMcGoo »

Ovg wrote:2MrMcGoo

try plugin DirSizeCalc and search. http://www.freeimagehosting.net/6kkdz
Wow! Thank you Ovg. That worked perfectly!

Brilliant solution!
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2MrMcGoo
Thanks to Lefteous :D
Last edited by Ovg on 2014-02-26, 12:25 UTC, edited 1 time in total.
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
white
Power Member
Power Member
Posts: 4622
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Find & Delete Empty Folders

Post by *white »

MrMcGoo wrote:There are free programs that do this, but is there any way to find empty folders and subfolders within TC so they can be deleted?
Using Total Commander only without any additional plugins, it's awkward but can be done.

Save the following text in a file named TCDeleteEmptyFolders.b64 and then double click the file in Total Commander.

Code: Select all

MIME-Version: 1.0
Content-Type: application/octet-stream; name="TCDeleteEmptyFolders.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="TCDeleteEmptyFolders.zip"

UEsDBBQAAgAAANFZWkQAAAAAAAAAAAAAAAATAAAARGVsZXRlRW1wdHlGb2xkZXJzL1BLAwQUAAIA
CABmYlpEgU3WbbgCAAD+BQAAHQAAAERl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U3WbbgCAAD+BQAAHQAAAAAAAAABACAAAAAx
AAAARGVsZXRlRW1wdHlGb2xkZXJzL1JFQURNRS5UWFRQSwUGAAAAAAIAAgCMAAAAJAMAAAAA
Inside is this:
DeleteEmptyFolders\README.TXT wrote:(Don't create any sub folders in this folder!!!)

Add 'Delete empty folders in right panel' function to Total Commander
=====================================================================

This file describes how you can use Total Commander to find and delete
folders with no files in it. Folders containing folders but no files
will also be deleted.


INSTALLATION

1) In the Total Commander program folder, create a sub folder named
"DeleteEmptyFolders" and put this README.TXT file in it as a reminder.
(Unpack TCDeleteEmptyFolders.zip to the Total Commander program folder)

2) Add the following to the [SyncOptions] section in wincmd.ini
(menu Configuration/Change Settings Files Directly)

[SyncOptions]
DeleteEmptyFolders_L=%commander_path%\DeleteEmptyFolders\
DeleteEmptyFolders_Wcs=|*
DeleteEmptyFolders_Flags=25|63|6

3) Add the following button to your button bar
(select and copy text between BEGIN and END and paste onto your button bar)

========BEGIN========
TOTALCMD#BAR#DATA
SYNCOPEN DeleteEmptyFolders

wcmicons.dll
Delete empty folders in right panel


-1
=========END=========


USAGE

1) In the right panel go to desired folder and click the
'Delete empty folders in right panel' button

2) In the synchronize directories dialog click the Compare button
and then the Synchronize button

3) Click the OK button to delete the empty folders

4) Afterwards, you may have to refresh the contents of the right panel
(press Ctrl+R or F2 while right panel is active)
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2white

You are a rock! :-) I take off my hat to you!
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6492
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

2white
For me the steps Compare and Syncronizealways
want to copy the readme.txt from left to right.
The option Right: Delete all empty directories is grayed out
?
Last edited by Horst.Epp on 2014-02-26, 12:15 UTC, edited 1 time in total.
User avatar
white
Power Member
Power Member
Posts: 4622
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Horst.Epp wrote:2white
For me the steps Compare and Syncronize always want to copy the readme.txt to the directory to be deleted.
?
Check the filter at the top middle. It should read "|*" , not "*.*"!
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6492
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

white wrote:
Horst.Epp wrote:2white
For me the steps Compare and Syncronize always want to copy the readme.txt to the directory to be deleted.
?
Check the filter at the top middle. It should read "|*" , not "*.*"!
Thanks, found it.
My filter was |*\
Don't know why I had that \ on end of the string
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

When using dirsizecalc for this task there are better fields than 'Size' - 'dirsizecalc.Contains'=Files=No' for example.

See the documentation for more info.
http://lefteous.totalcmd.net/tc/docs/dirsizecalc/readme.htm#use_cases_delete_empty_folder_trees
User avatar
Peter
Power Member
Power Member
Posts: 2064
Joined: 2003-11-13, 13:40 UTC
Location: Schweiz

Post by *Peter »

Since September 2014, there is a similar tool:

Empytcheck - http://www.totalcmd.net/plugring/emptycheck.html

Peter
TC 10.xx / #266191
Win 10 x64
User avatar
makinero
Senior Member
Senior Member
Posts: 268
Joined: 2013-10-26, 10:05 UTC

Post by *makinero »

1. Size (bytes KB, MB or GB)
2. Allocated (bytes KB, MB or GB)
3. % of percent
4. Total Files
:D
http://www.imagebam.com/image/ec89c3358936352
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2makinero
What is your point? Is this an Explorer extension or another plugin?

Size in percent relative to parent sounds interesting!

Empytcheck
All the checks are performed in foreground thread, so that highlighting schemes with this plugin displayed the colors immediately when navigating file system.
I wonder if there are many content plugins that actually create threads. TC itself might call content plugins in a background thread if the plugin allows it. DirSizeCalc doesn't create threads BTW
Gert
Junior Member
Junior Member
Posts: 5
Joined: 2022-10-11, 09:17 UTC

Re: Find & Delete Empty Folders

Post by *Gert »

I tried the suggestion by @white:
white wrote: 2014-02-26, 11:22 UTC
MrMcGoo wrote:There are free programs that do this, but is there any way to find empty folders and subfolders within TC so they can be deleted?
Using Total Commander only without any additional plugins, it's awkward but can be done.

Save the following text in a file named TCDeleteEmptyFolders.b64 and then double click the file in Total Commander.
...
and it uses the Command-> "Synchrinize Dirs.." functionality which maybe due to this added sub directory in the program folder now has an "empty directories" checkbox (but I seem to remember it, so not sure whether that is really a new addition).

My point is that the base folders in a large subtree which only contain folders but have no files are still mentioned for delete when you press synchronize, but when you press synchronize they magically survive the deletion. That is exactly what you want, but it is a bit a daunting task to press the Synchronize button in that case. Could we not better not offer those base folders at all that contain deep in the tree still some files in some subfolder? It would make me feel much more comfortable pressing the button.
Fla$her
Power Member
Power Member
Posts: 2310
Joined: 2020-01-18, 04:03 UTC

Re: Find & Delete Empty Folders

Post by *Fla$her »

Gert wrote: 2022-10-28, 09:01 UTCit is a bit a daunting task to press the Synchronize button
I advise you to take a look here. There you will find faster and simpler solutions, in particular, without dialogs.
Overquoting is evil! 👎
Post Reply