The distribution agent failed to create temporary files

Error 5 is an NTFS permissions problem. What account is the SQL Agent service on the distributor running under?


The error was caused because the SQL Server service could not write to C:\Program Files\Microsoft SQL Server\100\COM.

Changing the service account to Local System will solve this issue but also give too much un-needed rights to SQL Server, so you should set the service to run using a user account (either local or domain), put this account into the SQLServerMSSQLUser group, and give this group WRITE permissions on this folder (it is not the same as unticking "read-only" on folder properties).

There is no problem using Local System for development/tests environments, but please consider a more secure option on production servers.