--script to delete file from sql server instance1
Declare @DeleteDate varchar(50)
Declare @DeleteExecuteSQL varchar(1000)
Set @DeleteDate = cast(DATEADD(day,-3,GetDate()) as varchar(50))
Set @DeleteExecuteSQL =
'EXECUTE master.sys.xp_delete_file 0,N''V:\MSSQL$instance1\BackUp\Daily\Client000\' + @@servername + '\User'',N''bak'',N' + quotename(@DeleteDate,'''') + ',1'
print @DeleteExecuteSQL
--Execute (@DeleteExecuteSQL)