How to delete all empty (sub)folders inside a dirtree?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
pstein
Posts: 125
Joined: 09 Nov 2011 01:42

How to delete all empty (sub)folders inside a dirtree?

#1 Post by pstein » 28 Aug 2017 04:43

Assume I have the following topnode dir of a directory tree:

D:\tools\aaa\logs\

How can I delete all empty folders inside this topnode?

If the current directory contains an empty sub directory recursively then this should be deleted first....

How can I achieve this from dos batch script?

The top node should never been deleted.

Peter


Post Reply