Here's some code that did the trick:
SETLOCAL ENABLEDELAYEDEXPANSION
Set Default=default_hosts\hosts
FOR /f "tokens=*" %%a in ('dir /a-d /b /s "hosts_to_test\*.*"') DO (
FC "%Default%" "%%a"
IF NOT ERRORLEVEL 1 (
DEL /q "%%a"
Set DelDir=%%~dpa
Set DelDir=!DelDir:~-1!
RD "%%~dpa"
)
)
-bear
__________________
It's alot easier to ask for forgiveness then it is to ask for permission.
|