Maintenance Cleanup Task can be used to remove files related to Maintenance Plans. You can learn more about it in BOL here.

SQL 2005 RTM (32bit and 64bit)

In SQL Server 2005 RTM, the Maintenance Cleanup Task doesn't allow you to delete maintenance plan files from subfolders. As per BOL:

In contrast to earlier versions of the Maintenance Cleanup task, the SQL Server 2005 version of the task does not delete files in the subdirectories of the specified directory. This constraint reduces the surface area of any attack that may exploit the functionality of the Maintenance Cleanup task to delete files maliciously.

Service Pack 1 Enhancements

However, this limitation means that you have to create a Maintenance Cleanup Task for each file that you want to delete. This could be inconvenient if you have many databases on your server and you back them up under different sub-folders.

With the launch of service pack 1, Microsoft has removed this restriction. Now, you have to check the checkbox against "Include first-level subfolders" in the Maintenance Cleanup Task to delete folders under sub-directories.

Hope this helps!

POSTED BY : Sanchan Saxena