📎 AI Summary:
The thread discusses how to create a script to delete daily backup folders or files using Windows Task Scheduler. The original poster seeks a solution to automate the deletion process but receives a suggestion to use PowerShell's Remove-Item command. They then consider implementing specific commands for folders and files, planning to automate the task by scheduling it daily.

filmoore54

New Member
Member details
Joined
Sep 8, 2021
Messages
2
Thread Author #1
Looking for a script that will delete daily backup folders or files. Id like to use task scheduler to run it on a daily basis...
 

Solution
You would need to be a lot more specific.

*POWERSHELL*
Remove-Item -Path 'C:\Somepath' -Recurse
Would be enough to delete the directory C:\Somepath. If it needs to look at MAC times and delete based on that you could do some some simple filtering with Where-Object.

Neemobeer

Windows Forum Team
Staff member
Member details
Joined
Jul 4, 2015
Messages
8,995
You would need to be a lot more specific.

*POWERSHELL*
Remove-Item -Path 'C:\Somepath' -Recurse
Would be enough to delete the directory C:\Somepath. If it needs to look at MAC times and delete based on that you could do some some simple filtering with Where-Object.
 
Solution

filmoore54

New Member
Member details
Joined
Sep 8, 2021
Messages
2
Thread Author #3
If I understand it correctly, then the following statements would do what I am attempting...I just have to figure out the variables in order to do it on a daily basis and then create a task to run it...

Folder
Remove-Item -Path 'B:\DBBackups\2021-08-30_22-00-02' -Recurse

File
Remove-Item -Path 'F:\Backup\FullBackup09072021' -Recurse