Batch script to delete file older than 30 day
Solved/Closed
sd6340
eie - Apr 18, 2019 at 12:20 AM
- Posts
- 1
- Registration date
- Thursday February 26, 2009
- Status
- Member
- Last seen
- February 27, 2009
eie - Apr 18, 2019 at 12:20 AM
Related:
- Batch script to delete files older than 30 days
- Batch script to delete files older than 30 days in windows - Best answers
- Batch file to delete files older than 1 hour - Best answers
- Move files older than X days: Windows 11,10,8,7 - Guide
- Batch script to delete subfolder from multiple subfolders ✓ - Forum - Windows 10
- Batch command for deleting both folders and contents order than 30 days ✓ - Forum - Windows 10
- Batch Script to Move files older than 30days - Forum - Windows
- UNC Paths not supported in Batch Script - Forum - Windows 7
12 replies
Try the following command to automatically delete files at the root of a directory. This command can be saved in a .bat file and scheduled with scheduled tasks.
forfiles /p "PATH" /s /d -30 /c "cmd /c del @file : date >= 30 days >NUL"
Change "PATH" with the path where you want the files to be deleted. If there are no spaces in the path you dont need the "-symbol.
forfiles /p "PATH" /s /d -30 /c "cmd /c del @file : date >= 30 days >NUL"
Change "PATH" with the path where you want the files to be deleted. If there are no spaces in the path you dont need the "-symbol.
Jun 23, 2010 at 04:44 AM
Jun 30, 2010 at 01:05 AM
Aug 13, 2010 at 11:45 AM
Aug 30, 2010 at 09:10 AM
'forfiles' is not recognized as an internal or external command.
I've tried to run this at the command line and in a batch file.
Ideas?
Sep 1, 2010 at 01:53 PM