all you have to do is change the version check from
IF @OSVersion = '5.2'
to IF @OSVersion >= '5.2'
umm yeah thats easy.
also I know this is an old thread but I am using this due to an issue I am having using the maint cleanup task not working. this is kinda slow if you call it repetavily and with many file.. I use a cursor to call it and it takes abt 20 min. Not really in a hurry though
DECLARE @databasename as varchar(200)
declare @strSQL as nvarchar (4000)
DECLARE Curse CURSOR local fast_forward
FOR
SELECT
name
FROM
master.dbo.sysdatabases
WHERE
name not in ('tempdb','AdventureWorks','AdventureWorksDW')
order by name desc
OPEN Curse
FETCH next FROM Curse INTO @databasename
WHILE @@fetch_status = 0
BEGIN
set @strSQL = 'EXEC DBA.dbo.usp_Admin_Delete_Files_By_Date @SourceDir = ''\\resnetapp01\prodsqlbackups$\NIGHTLY\RESMSSQL2008\' + @databasename + '\'', @SourceFile = ''*'', @DaysToKeep = 5'
EXEC dbo.sp_executesql @strSQL
fetch next from Curse into @databasename
END
close Curse
deallocate Curse
Michael B
Data Architect
MCT, MCITP(SQL DBA 2005/2008),MCTS, MCP,MCDBA