Replication Snapshot folder not cleaning up The job that I thought was supposed to clean up old snapshots isn't removing the old files.  The retention is left at default yet there are snapshots months old which remain.  The job runs as the agent account (maybe I should try a proxy account?)  and this account has full permissions to the folder.

I have checked sp_configure to ensure xp_cmdshell is enabled and it is.  

The cleanup job runs the proc sp_MSsubscription_cleanup, however I can't see anywhere in that which would delete the old snapshot files.

Can anyone enlighten me?
Thanks
The MSDN Blog "SQL Server SSIS and Replication" has a post from a few years ago.
http://blogs.msdn.com/b/mangeshd/archive/2009/05/20/replication-snapshot-folder-cleanup.aspx

How these old snapshot folders are purged depends on the type of replication you are using:


For snapshot and transactional replication: Distribution cleanup agent purges the non-latest folders
For Merge replication: the snapshot agent itself will purge older folders. 


Chris Skorlinski, one of the developers on replication, had (from a few years ago) the following to say:  "For merge replication, the snapshot agent ... is responsible for cleaning up the last generated snapshot. The snapshot agent will only try once to remove the previous snapshot files so if those files were locked at that moment (by the merge agent e.g.), it is possible that snapshot files will be left over." 

He recommends that you check the snapshot agent history to see if errors were reported.

If this is a continuing problem perhaps you could create a PowerShell script to remove the older snapshot folders. And, of course, you can manually delete them, though that is not a useful long-term solution.