We help IT Professionals succeed at work.

Delete files and folders based on date in windows 10

jana
jana asked
on
Medium Priority
126 Views
Last Modified: 2019-06-19
Hello,

I am trying to create a batch file in windows 10 that would delete all files & folders from a specific folder and its sub-folders that there modified date is prior 5/23/2019.  I have used DateModified:<5/23/2019, then highlight them, then delete them, but for some reason next time run DateModified:<5/23/2019
 to make sure all prior 5/23/2019 has been deleted, more are displayed.  Also tried placing *.* then sorting by date but since so many files, takes super long but also after deleting, I search again,more files prior 5/23/2019.  I also tried ForFiles but also, no success.

Help.
Comment
Watch Question

Test your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Top Expert 2016
Commented:
Get yourself a copy of DELAGE32, it's free and great for stuff like this.



»bp

Author

Commented:
Hi, I never seen a site that had ".de" - is it trusted? (don't want to download anything bad)
Bill PrewTest your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Top Expert 2016

Commented:
Definitely trusted …
Bill PrewTest your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Top Expert 2016

Commented:
That's just the country domain of the authors site, hosted in their country ofGermany.

Author

Commented:
I did search the apps after asking if it safe and found various references as to being infected or bad (see here, here), but thanks that u said its trusted - will try
Bill PrewTest your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Top Expert 2016

Commented:
And here is an older question that is about the same as what you are looking for.  I also posted a VBS script there if you are interested in that approach.

Script to permanetly delete folders & contents based on date


»bp

Author

Commented:
Will check it ...

Author

Commented:
Thank u very much!  I was afraid of infection but after running ion a test computer, Worked!
Bill PrewTest your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Top Expert 2016

Commented:
Great, glad that helped.


»bp