Jump to content

List All Empty Folders


Recommended Posts

Posted

I have a folder with over 3000 vendor files within that folder. Each vendor

files has 10 subfolders, some containing documents and others with no

documents;

 

C:\Vendor\Name\

C:\Vendor\Agreement\Confidentiality\

C:\Vendor\Agreement\W-9\

C:\Vendor\Agreement\Time_Log\

 

How can I perform a search to list all folders within \Vendor that are blank?

I have tried a search in Explore but cannot get accurate information.

  • Replies 4
  • Created
  • Last Reply
Guest Pegasus \(MVP\)
Posted

Re: List All Empty Folders

 

 

"Francis" <Francis@discussions.microsoft.com> wrote in message

news:2DB6D575-A8E7-427B-9959-EC54334AE5E2@microsoft.com...

>I have a folder with over 3000 vendor files within that folder. Each vendor

> files has 10 subfolders, some containing documents and others with no

> documents;

>

> C:\Vendor\Name\

> C:\Vendor\Agreement\Confidentiality\

> C:\Vendor\Agreement\W-9\

> C:\Vendor\Agreement\Time_Log\

>

> How can I perform a search to list all folders within \Vendor that are

> blank?

> I have tried a search in Explore but cannot get accurate information.

 

Before you can perform a search for "blank" folders you need to think about

the meaning of "blank". Is it

- A folder containing no visible files but perhaps some folders

- A folder containing no files but perhaps some folders

- A folder containing neither files nor folders

Posted

Re: List All Empty Folders

 

These would be folders that contain neither files nor folders. They are blank.

 

thank you for responding.

 

"Pegasus (MVP)" wrote:

>

> "Francis" <Francis@discussions.microsoft.com> wrote in message

> news:2DB6D575-A8E7-427B-9959-EC54334AE5E2@microsoft.com...

> >I have a folder with over 3000 vendor files within that folder. Each vendor

> > files has 10 subfolders, some containing documents and others with no

> > documents;

> >

> > C:\Vendor\Name\

> > C:\Vendor\Agreement\Confidentiality\

> > C:\Vendor\Agreement\W-9\

> > C:\Vendor\Agreement\Time_Log\

> >

> > How can I perform a search to list all folders within \Vendor that are

> > blank?

> > I have tried a search in Explore but cannot get accurate information.

>

> Before you can perform a search for "blank" folders you need to think about

> the meaning of "blank". Is it

> - A folder containing no visible files but perhaps some folders

> - A folder containing no files but perhaps some folders

> - A folder containing neither files nor folders

>

>

>

Guest Pegasus \(MVP\)
Posted

Re: List All Empty Folders

 

 

"Francis" <Francis@discussions.microsoft.com> wrote in message

news:2DB6D575-A8E7-427B-9959-EC54334AE5E2@microsoft.com...

>I have a folder with over 3000 vendor files within that folder. Each vendor

> files has 10 subfolders, some containing documents and others with no

> documents;

>

> C:\Vendor\Name\

> C:\Vendor\Agreement\Confidentiality\

> C:\Vendor\Agreement\W-9\

> C:\Vendor\Agreement\Time_Log\

>

> How can I perform a search to list all folders within \Vendor that are

> blank?

> I have tried a search in Explore but cannot get accurate information.

 

Try this batch file:

@echo off

set Target=D:\Test Folder

echo >> c:\TempVBS.vbs Set oFSO = CreateObject("Scripting.FileSystemObject")

echo >> c:\TempVBS.vbs CheckFolder("%Target%")

echo.>> c:\TempVBS.vbs

echo >> c:\TempVBS.vbs Sub CheckFolder(sName)

echo >> c:\TempVBS.vbs If oFSO.GetFolder(sName).Files.Count = 0 _

echo >> c:\TempVBS.vbs And oFSO.GetFolder(sName).SubFolders.Count = 0 _

echo >> c:\TempVBS.vbs Then WScript.Echo sName

echo >> c:\TempVBS.vbs For Each oFolder In oFSO.GetFolder(sname).SubFolders

echo >> c:\TempVBS.vbs CheckFolder(sName ^& "\" ^& oFolder.Name)

echo >> c:\TempVBS.vbs Next

echo >> c:\TempVBS.vbs End Sub

cscript //nologo c:\TempVBS.vbs

del c:\TempVBS.vbs

Guest Francis
Posted

Re: List All Empty Folders

 

Thank you for your help. This may give me what i need. appreciate

 

"Pegasus (MVP)" wrote:

>

> "Francis" <Francis@discussions.microsoft.com> wrote in message

> news:2DB6D575-A8E7-427B-9959-EC54334AE5E2@microsoft.com...

> >I have a folder with over 3000 vendor files within that folder. Each vendor

> > files has 10 subfolders, some containing documents and others with no

> > documents;

> >

> > C:\Vendor\Name\

> > C:\Vendor\Agreement\Confidentiality\

> > C:\Vendor\Agreement\W-9\

> > C:\Vendor\Agreement\Time_Log\

> >

> > How can I perform a search to list all folders within \Vendor that are

> > blank?

> > I have tried a search in Explore but cannot get accurate information.

>

> Try this batch file:

> @echo off

> set Target=D:\Test Folder

> echo >> c:\TempVBS.vbs Set oFSO = CreateObject("Scripting.FileSystemObject")

> echo >> c:\TempVBS.vbs CheckFolder("%Target%")

> echo.>> c:\TempVBS.vbs

> echo >> c:\TempVBS.vbs Sub CheckFolder(sName)

> echo >> c:\TempVBS.vbs If oFSO.GetFolder(sName).Files.Count = 0 _

> echo >> c:\TempVBS.vbs And oFSO.GetFolder(sName).SubFolders.Count = 0 _

> echo >> c:\TempVBS.vbs Then WScript.Echo sName

> echo >> c:\TempVBS.vbs For Each oFolder In oFSO.GetFolder(sname).SubFolders

> echo >> c:\TempVBS.vbs CheckFolder(sName ^& "\" ^& oFolder.Name)

> echo >> c:\TempVBS.vbs Next

> echo >> c:\TempVBS.vbs End Sub

> cscript //nologo c:\TempVBS.vbs

> del c:\TempVBS.vbs

>

>

>


×
×
  • Create New...