Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - remove all empty folders

Reply
 
Old 07-31-2008   #1 (permalink)


Vista Home Premium 32bit
 
 

remove all empty folders

I have another problem from a lot of days.
Makings an experiment I made a mistake and I've created a lot of empty folders (several thousands). I'd like to know how I can delete them if they don't contain files.
Thanks.

My System SpecsSystem Spec
Old 07-31-2008   #2 (permalink)


Vista Ultimate 32/64 bit
 
 

Re: remove all empty folders

I've not tried this software, but you could give it a shot to see if it does what you want... RED ~ jonasjohn.de: remove empty directories (freeware for windows)
My System SpecsSystem Spec
Old 07-31-2008   #3 (permalink)


Vista Home Premium 32bit
 
 

Re: remove all empty folders

Wow. It's solved my problem. Great sw. Thank you very much.
However if someone can give me a solution with powershell it would be appreciate.
My System SpecsSystem Spec
Old 07-31-2008   #4 (permalink)


Vista Ultimate 32/64 bit
 
 

Re: remove all empty folders

Glad it worked for you.
My System SpecsSystem Spec
Old 07-31-2008   #5 (permalink)
/\/\o\/\/ [MVP]


 
 

Re: remove all empty folders

for a powershell solution see:

http://www.microsoft.com/technet/scr...pstip0530.mspx

Greetings /\/\o\/\/
http://thePowerShellGuy.com

"sardinian_guy" wrote:
Quote:

>
> Wow. It's solved my problem. Great sw. Thank you very much.
> However if someone can give me a solution with powershell it would be
> appreciate.
>
>
> --
> sardinian_guy
>
My System SpecsSystem Spec
Old 07-31-2008   #6 (permalink)


Vista Home Premium 32bit
 
 

Re: remove all empty folders

I was sure that it was possible to solve with powershell.
Thank you very much and I give you my compliments for your great knowledge. I found your solutions everywhere in the web.
My System SpecsSystem Spec
Old 07-31-2008   #7 (permalink)
Kiron


 
 

Re: remove all empty folders

# remove empty folders
ls <path> -r -fo | ? {$_.psIsContainer} |
sort fullName -des | ? {!(ls $_.fullName -fo)} | ri

Check out this thread to see why it's better to sort them in descending order
http://groups.google.com/group/micro...41347ebae682fb

--
Kiron
My System SpecsSystem Spec
Old 08-01-2008   #8 (permalink)


Vista Home Premium 32bit
 
 

Re: remove all empty folders

Thanks again, even for the link!
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Remove empty folders in C:\Windows\Temp ?? Vista General
file folder icons display non-empty folders as empty Vista file management
Remove empty folders PowerShell
Can I Permanently Remove Empty Removable Drives? Vista hardware & devices
empty folders??? Vista networking & sharing


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46