I just encountered this issue with Maintenance Cleanup Task
Executing the query "EXECUTE master.dbo.xp_delete_file 0,N'',N'bak',N'2009-06-16T14:19:14'
" failed with the following error: "Error executing extended stored procedure: Invalid Parameter".
Possible failure reasons: Problems with the query,
"ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
EXECUTE master.dbo.xp_delete_file 0,N'''',N''bak'',N''2009-06-16T14:19:14''
Executed in SSMS:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'bak'.
Any idea on what the issue is since the Maint Plan is generating the code