Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I get a list of all my empty folders on c:\ ?

46 views
Skip to first unread message

Marco Maier

unread,
May 16, 2004, 4:19:05 PM5/16/04
to
Here is the shortest solution I have found.
It seems to work.

@echo off
for /r "c:\" /d %%a in (*) do (
dir /b /s /a "%%a" | findstr /r ".*" >nul
if errorlevel 1 echo %%a)

--
Marco Maier

Matthias Tacke

unread,
May 16, 2004, 5:13:15 PM5/16/04
to
Marco Maier wrote:

Without going into detail, there one 3 chars shorter:
the "/r " is redundant since reg exp is default with findstr.

--
Greetings
Matthias________________________________________
For help on nt commands enter in a cmd window:
W2K>HH windows.chm::ntcmds.htm XP>HH ntcmds.chm

Marco Maier

unread,
May 16, 2004, 5:30:12 PM5/16/04
to
Matthias Tacke wrote in message <news:c88lhb$i3m$05$1...@news.t-online.com> :

>>
> Without going into detail, there one 3 chars shorter:
> the "/r " is redundant since reg exp is default with findstr.

Thanks,and this is even shorter:

@echo off
for /r \ /d %%a in (*) do (
dir /b /s /a "%%a"|findstr .>nul


if errorlevel 1 echo %%a)

--
Marco Maier

Marco Maier

unread,
May 16, 2004, 8:30:50 PM5/16/04
to
Marco Maier wrote in message <news:v6em6ps8...@MRC.MIR.SID.75> :

But the following is better, because it displays folders with
empty subfolders too:

@echo off
for /r \ /d %%a in (*) do (

2>nul dir /b /s /a-d "%%a"|findstr .>nul

0 new messages