PC Review


Reply
Thread Tools Rate Thread

Command to identity empty folders

 
 
Curious
Guest
Posts: n/a
 
      8th Jun 2007
Is there a Windows command or utility that I can use to find out in a
given folder, what folders are empty (meaning they contain no files)?

 
Reply With Quote
 
 
 
 
Herb Martin
Guest
Posts: n/a
 
      8th Jun 2007

"Curious" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is there a Windows command or utility that I can use to find out in a
> given folder, what folders are empty (meaning they contain no files)?


You can do a Dir command for FILES (negative for directories) and
apparently it sets the errorlevel if file not found (no regular files).

dir DirName /a-d & if errorlevel 1 echo Errorlevel: %errorlevel% no files
found

This means you can test for the errorlevel and and use the results to
execute different batch code.

/ad gives only results where the attribute is a DIRECTORY (or Junction
Point),
and /a-d changes this to where the attribute is "not a directory".


--
Herb Martin, MCSE, MVP
http://www.LearnQuick.Com
(phone on web site)


 
Reply With Quote
 
Timo Salmi
Guest
Posts: n/a
 
      9th Jun 2007
Curious <(E-Mail Removed)> wrote:
> Is there a Windows command or utility that I can use to find out in a
> given folder, what folders are empty (meaning they contain no files)?


43} Is there a way of counting the number of files in a folder?
57} How do I get a list of all my empty folders on c:\ ?
195399 May 17 2007 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi

All the best, Timo

--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
private.php?do=newpm&u= <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland
Timo's FAQ materials at http://www.uwasa.fi/~ts/http/tsfaq.html
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
file folder icons display non-empty folders as empty nodaway Windows Vista File Management 0 24th Dec 2007 07:57 PM
how can User.Identity.Name be empty? =?Utf-8?B?Q2hhcmxlc0E=?= Microsoft ASP .NET 3 2nd Mar 2007 02:53 PM
Re: Getting @@identity from INSERT command Jos Microsoft ADO .NET 0 30th Jul 2003 07:44 AM
Re: Getting @@identity from INSERT command Allen Davis Microsoft ADO .NET 0 29th Jul 2003 09:18 PM
Outlook 2002 Delete Empty Folders from Personal Folders Greg Hadlock Microsoft Outlook Program Addins 0 29th Jul 2003 03:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:51 PM.