Hello hopflop !
hopflop <---@---.--> wrote:
>> I forgot the RETURN of course:
> I think you forgot ENDIFF too :)
:-) Yes...
But in my message only, not in the batch that works.
> I don't think ISDIR takes wildcards, so it won't tell you if there are
> any directories in %i.
...you are right. The HELP talks about a "path" but doesn't assume anything
further.
> Try something else, maybe @FINDFIRST with +d attribute
...you are right again ! This finally works as expected:
=== Begin Windows Clipboard ===
DIR /A:D /S /B | FOR %i IN (@CON) GOSUB loop
QUIT
:loop
IFF ISFILE %i\*.* THEN
ECHO CONTAINING FILES : %i
ELSEIFF EXIST %@FINDFIRST["%i\*.*",d] THEN
ECHO CONTAINING DIRS : %i
ELSE
ECHO READY TO DELETE : %i
ENDIFF
RD /Ne %i
RETURN
=== End Windows Clipboard ===
I don't find any nested empty directories after passing the batch, so it seems
that "RD /Ne %i" deletes them first; but I'm not 100% sure of that right now.