Batch command for deleting both folders and contents order than 30 days
Solved/Closed
gmwenechanya
Posts
2
Registration date
Saturday 1 February 2020
Status
Member
Last seen
3 February 2020
-
1 Feb 2020 à 13:32
David Webb Posts 3177 Registration date Monday 25 November 2019 Status Member Last seen 15 May 2023 - 3 Feb 2020 à 09:45
David Webb Posts 3177 Registration date Monday 25 November 2019 Status Member Last seen 15 May 2023 - 3 Feb 2020 à 09:45
Related:
- Batch script to delete files in a folder older than 30 days
- Batch delete - Best answers
- Batch script to delete files older than 30 days - Best answers
- Batch copy folder ✓ - Programming Forum
- Batch script to delete files older than 30 days ✓ - Windows Forum
- Tech gifts under $30 - Home - Buying guides
- How to unlock safe folder in files ✓ - Android Forum
- Anvi folder locker reset key - Guide
1 response
David Webb
Posts
3177
Registration date
Monday 25 November 2019
Status
Member
Last seen
15 May 2023
6,928
1 Feb 2020 à 17:08
1 Feb 2020 à 17:08
Hello, a similar question was asked and answered in this forum post.
The best answer was the following:
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.
Let me know if that helps!
The best answer was the following:
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.
Let me know if that helps!
David Webb
Content Editor and Community Manager - CCM.net
3 Feb 2020 à 09:01
3 Feb 2020 à 09:45