Solved

How can I produce a list of empty folder ?

Posted on 2009-05-18
7
281 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

746 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

11 Experts available now in Live!

Get 1:1 Help Now