Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 319
  • Last Modified:

How can I produce a list of empty folder ?

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
mindwarpltd
Asked:
mindwarpltd
  • 3
  • 2
  • 2
1 Solution
 
Point-In-CyberspaceCommented:
dir  *.   /s

0
 
Point-In-CyberspaceCommented:
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
 
mindwarpltdAuthor Commented:
That produces a list of folders, not empty folders.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Christop123Commented:
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
 
mindwarpltdAuthor Commented:
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
 
Point-In-CyberspaceCommented:
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
 
Christop123Commented:
Doh... not even an assist.  :(
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now