When trying to run the following database backup command from my code I get an "Operating system error 5(Access is denied.)" error. This is because the log on account for the SQL Server Windows Service is 'Network Service' and that does not have access to right to this folder.
BACKUP DATABASE [AE3DB] TO DISK = 'c:\AE3\backup\AE3DB.bak'
My question is, from my code how would I go about figuring out where on the C drive 'Network Service' is allowed to right the backup to?
NOTE: This is a distributed application so I cannot easily change the log on for the SQL Server Windows Service to the 'Local System' account that would be able to right to that folder.