Blog to understand automation concepts in QTP, Selenium Webdriver and Manual Testing concepts

Batch file to delete all files from folder

Below code shows how to delete all files from a folder matching the specific criteria.

FORFILES /p "E:\test\Result" /s /m *.* /D -5 /C "cmd /c del *.* /F /Q"

The above code will delete all files in the folder "E:\test\Result" recursively in the sub folder matching all the files which are older than 5 days.

No pop-up and prompt will be displayed and file will be deleted

No comments:

Post a Comment