Jump to content

Delete empty directories


zvd
 Share

Recommended Posts

Guest checkist

Well, ultra-ugly, super-inefficient method is..

cmd /c Xcopy [source] [temporary target] /s /a/h

delete [source], and rename [temporary target] directory to original [source]

Xcopy's '/s' switch recursively copies "Nonempty" subdirectories.

It may work. but it's too slow for any practical use.

(In short, this is useless)

Link to comment
Share on other sites

Hi,

there are various recursive FileSearch" utilities on the forum.

At least one of them searches for directories too;

FileSearch gafrost

When you get to

              $hFile = FileFindFirstFile($szRoot & "*.*")

              If $hFile >= 0 Then

I imagine you could do an "else" (if no files ie empty), delete the current directory, or add name to a file for checking and deleting at the end from the file? -Interested to hear if you get it going!

Randall

Link to comment
Share on other sites

  • Developers
Here is a script example that can delete files older than and remove empty directories... Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...