I set up a Sqlserver Maintenance Cleanup Task, but couldn’t get it to delete the appropriate backup files.

The log looked like this:

Maintenance Cleanup Task ()
Maintenance Cleanup on Local server connection
Cleanup Database Backup files
Age: Older than 5 Weeks
Task start: 2011-11-09T11:45:01.
Task end: 2011-11-09T11:45:01.
Success
Command:EXECUTE master.dbo.xp_delete_file 0,N''F:mssql_backup'',N''.bak'',N''2011-10-05T11:45:01'',1
GO

…which looks reasonable.

It was showing ‘Success’

My mistake was that I had entered .bak rather than just bak as the ‘File extension’. The ‘.’ is not needed. Presumably it was looking for files called ‘whatever..bak’