Delete files in batch with without error message

batch-filedelete-file

I use the command

del "info*" 

to delete a group of files starting with "info". The problem is that sometimes there
is at least one of these files that exist,therefore they are deleted and others times no files exist and and error message happens.
I need my script must not block if these files don't exist.

I look at options for del /? but nothing help me go ahead.

Could you help me, please?

Best Answer

Did you tried something like this :

IF EXIST [Filename] (
    del [Filename]
) ELSE (
    ...
)
Related Topic