Hi Ben,

I had tried something very similar to this, and it didn't work,
that's how I came upon the idea of redirecting the filenames to a
text file.

I took the notes and line references out of your file and cut and
copied it to a file called KILL.BAT, and this is how I ran it:

kill *.txt

And I ran it in the directory of the files I want to delete.
Could it be that the OpenDOS's FIND command doesn't return an
error level and this is why it doesn't work?

Thanks very much,
Boanne

Ben A L Jemmett <[EMAIL PROTECTED]> wrote:

<-- Cut and remove footnote markers -->
@ECHO OFF    [0]
IF %1!==! GOTO ERROR
IF %2!==CHECK! GOTO CHECKING
FOR %%A IN (%1) DO CALL %0 %%A CHECK    [1]
GOTO END
:ERROR
ECHO You need to give me a wildcard filespec!
ECHO e.g. %0 *.TXT
GOTO END
:CHECKING
FIND elephant %1
IF ERRORLEVEL 1 DEL %1    [2]
:END
<-- Cut -->

[0] For MS-DOS < 3.3 (or equivalent) use ECHO OFF
[1] For MS-DOS < 3.3 (or equivalent) use ... COMMAND /C %0.BAT %%A CHECK
[2] Might be IF NOT ERRORLEVEL 1 - I always forget whether FIND gives 1 for
found or not found.

--
FROM: Over the hills and far away...
[EMAIL PROTECTED]
A Dinosaurs Garden (collection of DOS links and files)
http://www.sound.net/~ashelton/dinosaur/dg.htm

*1/2 of debugging is teaching the bugs to co-operate!

To unsubscribe from SURVPC send a message to [EMAIL PROTECTED] with 
unsubscribe SURVPC in the body of the message.
Also, trim this footer from any quoted replies.

Reply via email to