On Mon, 26 Jul 2004 14:07:22 -0700, "Steve"
<(E-Mail Removed)> wrote:
>Is there an easy way of deleting empty file folders in
>windows or a third party program? We have made major
>modifications to our data file stucture and would like to
>eliminate all of the now empty folders.
@echo off
if {%1}=={} @echo Syntax DelMT Folder&goto :EOF
if not exist %1 @echo Syntax DelMT Folder - %1 not found.&goto :EOF
setlocal
set folder=%1
:loop
set delSW=N
for /f "Tokens=*" %%f in ('dir %folder% /AD /S /b') do (
set fld="%%f"
set MT=Y
call :IsMT
)
if "%delSW%" EQU "Y" goto :loop
endlocal
goto :EOF
:IsMT
for /f "Tokens=*" %%m in ('dir %fld% /a /b') do (
set MT=N
)
if "%MT%" EQU "N" goto :EOF
rd /q %fld%
set delSW=Y
Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com