Solved

How can I produce a list of empty folder ?

Posted on 2009-05-18
7
290 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
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…

739 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