Solved

How can I produce a list of empty folder ?

Posted on 2009-05-18
7
282 Views
Last Modified: 2013-11-09
How can I produce a lis of empty folder?
I'm hoping I can use a DOS batch file, so I then just produce a batch file of the ones I want to remove
0
Comment
Question by:mindwarpltd
  • 3
  • 2
  • 2
7 Comments
 
LVL 8

Expert Comment

by:Point-In-Cyberspace
ID: 24412849
dir  *.   /s

0
 
LVL 8

Expert Comment

by:Point-In-Cyberspace
ID: 24412857
So you get the list of folders.

Now you can create a text file with it:


dir  *.  /s  > folderlist.txt

In text file you can manually remove what you need.


0
 

Author Comment

by:mindwarpltd
ID: 24412864
That produces a list of folders, not empty folders.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 1

Expert Comment

by:Christop123
ID: 24412915
I believe this link describes what you want to do:
http://www.microsoft.com/technet/scriptcenter/resources/qanda/jul06/hey0710.mspx

It made me a list of the folders on my drive that had a 0 byte count.
Hope that helps.
0
 

Author Comment

by:mindwarpltd
ID: 24412992
I got that script to work, but I know nothing about vbs scripts.

It didn't produce a list, it produced a lot of message boxes.
0
 
LVL 8

Accepted Solution

by:
Point-In-Cyberspace earned 500 total points
ID: 24413003
Then try this:

Save it on c:\ with name "listfolders.vbs"

Run it with

cscript c:\listfolders.vbs > list.txt

You have to run it in the folder from which you want to start.

Il file "list.txt" you'll get the list of empty folders


On Error Resume Next
 

Set FSO = CreateObject("Scripting.FileSystemObject")

ShowSubFolders FSO.GetFolder("C:\")
 

Sub ShowSubFolders(Folder)

    For Each Subfolder in Folder.SubFolders

        If Subfolder.Size = 0 Then

            Wscript.Echo Subfolder.Path

        End If

        ShowSubFolders Subfolder

    Next

End Sub

Open in new window

0
 
LVL 1

Expert Comment

by:Christop123
ID: 24413144
Doh... not even an assist.  :(
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now