Find and delete empty folders

User avatar
Timelord
4StarLounger
Posts: 504
Joined: 23 Jul 2010, 18:36
Location: Westlake, OHIO

Find and delete empty folders

Post by Timelord »

We have a process that was created in-house that unzips files into folders, deletes the zip file, and then the files in the folders are processed into our software. This leaves behind empty folders. The count of empty folders on one particular server is now well over 200,000 and graowing at a rate of about 300 per hour. Does anyone know of a tool that we could use to find empty folders and delete them? I have not found a biult in Windows tool to do this.
Who will you Inspire today?

User avatar
Bigaldoc
PlatinumLounger
Posts: 3757
Joined: 24 Jan 2010, 11:00
Location: Lexington, KY, USA

Re: Find and delete empty folders

Post by Bigaldoc »

I don't know if anything here looks promising to you. I've never used software to do this job.

http://www.google.com/search?as_q=delet ... as_rights=" onclick="window.open(this.href);return false;

User avatar
Timelord
4StarLounger
Posts: 504
Joined: 23 Jul 2010, 18:36
Location: Westlake, OHIO

Re: Find and delete empty folders

Post by Timelord »

Bigaldoc wrote:I don't know if anything here looks promising to you. I've never used software to do this job.

http://www.google.com/search?as_q=delet ... as_rights=" onclick="window.open(this.href);return false;
Thanks Al, I tried the iLivid from CNet and it did not even load properly. Actually, it does not have to be software, any script would be great too. My co-worker found a script on a different forumn ( for /f "usebackq" %%d in (`"dir /ad/b/s | sort /R"`) do rd "%%d" ) and the script is also failing.
Who will you Inspire today?

User avatar
Bigaldoc
PlatinumLounger
Posts: 3757
Joined: 24 Jan 2010, 11:00
Location: Lexington, KY, USA

Re: Find and delete empty folders

Post by Bigaldoc »

I tried the first one ("RED") since I told you I'd never tried this before.

It installed and ran OK for me (Win XP MCE) and, get this, it found over 4 thousand empty directories on my "little old" machine.

I might take another look some other time, but I didn't let it delete anything without checking ALL of them to make sure it didn't go too wild. If your in-house thing is consistent, your search for empties might be easier to verify than mine. These are all over my hard drive.

I did see a "batch" script in that Google but it's quite old. Maybe John Gray will pop in here with a suggestion.

User avatar
Timelord
4StarLounger
Posts: 504
Joined: 23 Jul 2010, 18:36
Location: Westlake, OHIO

Re: Find and delete empty folders

Post by Timelord »

My coworker just admitted that he got the script I mention above to work. He needed to add the directory level in the middle (that is what he said, I do not know scripts). Anyway, this is solved now.

Thanks Al!
Who will you Inspire today?

User avatar
aekyall
4StarLounger
Posts: 536
Joined: 05 Feb 2010, 23:23
Location: Whitehaven Cumbria UK

Re: Find and delete empty folders

Post by aekyall »

Al,
Having watched your exchange with Timelord I thought I'd have a look-see and so downloaded RED and let it run. It found 1007 'empty' folders (I've had Windows 7 (H) for three years). To be honest I don't recognise what most of the folders represent (or did represent), so I think I'll give it all a miss and leave well alone. Would be interesting to know though just what, if any, impact having large quantities of empty folders has on performance, disc space, etc etc :scratch: ?
Regards,
Regards,
Keith

User avatar
Bigaldoc
PlatinumLounger
Posts: 3757
Joined: 24 Jan 2010, 11:00
Location: Lexington, KY, USA

Re: Find and delete empty folders

Post by Bigaldoc »

aekyall wrote:Having watched your exchange with Timelord I thought I'd have a look-see ...
Your "caution" equals mine. The only time I'd ever do anything "carte blanche" like that would be immediately following a full backup image, just in case.