I have this batch file which is supposed to find and delete specific files if found, but it keeps returning and displaying errors when the files are not found. I had deleted the /S switch from the DELETE command to make the found files silent. The code is below:
For /F "delims=" %%A in (
'Dir /B/S "*,*" ^| findstr ",[0-9][0-9]*$" '
) Do Del "%%A"
DEL /Q *.bak
ECHO bak files deleted
DEL /Q *.prjpcb.zip
ECHO Project History Zips deleted
DEL /Q *.pcbdoc.zip
ECHO PCB History Zips deleted
DEL /Q *.SchDoc.zip
ECHO Schematic History Zips deleted
DEL /Q *.PcbLib.zip
ECHO PCB Library History Zips deleted
DEL /Q *.SchLib.zip
ECHO Schematic Library History Zips deleted
DEL /Q *.OutJob.zip
ECHO Output Jobs History Zips deleted
ECHO on
TIMEOUT 5
How do I get the file to display only the echo when it deletes the files and nothing if nothing is found?