0

I use Windows.

I want to delete all files and subfolders older than 5 days by system call.

I have this command, but i want to delete all files and subfolders older than 5 days.

FOR /D %i IN (C:\mydir*) DO RD /S /Q "%i"

DEL /Q C:\mydir*.*

Do you know an easier way?

  • "This question has been asked before and already has an answer." This is not true, because I want an CMD command nog a Powershell command. – Matheus Feb 26 '19 at 14:20
  • "...because I want a CMD command..." The list of Related Questions on the right side of the page will lead you to several batch file solutions, including: https://serverfault.com/questions/277616/how-to-delete-files-older-than-30-days-with-robocopy?rq=1 and https://stackoverflow.com/questions/9746778/ms-dos-batch-delete-old-files-in-directory/9747065#9747065 and https://stackoverflow.com/questions/51054/batch-file-to-delete-files-older-than-n-days. – Doug Deden Feb 26 '19 at 23:34

0 Answers0