Click here for important information about Computing.net.

Solved forfiles Fails in batch run if condition does not match

December 1, 2020 at 08:20:44
Specs: Windows 10, 16
Hi All,

I am curious to know how to resolve the below issue. Below script works only if the condition matches , else my batch job fails. How do I overcome ?
forfiles /p D:\Adv\Sum*.txt /d -30 /c "cmd /c Del @file" 2>&1 | find /v /i "ERROR: No files found with the specified search criteria."


See More: forfiles Fails in batch run if condition does not match


#1
December 1, 2020 at 17:33:43
✔ Best Answer
mebbe try:

forfiles /p D:\Adv\Sum*.txt /d -30 /c "cmd /c Del @file"||echo NO FILES FOUND


Reply ↓  Report •
Related Solutions


Ask Question