I am trying to implement an SQL Server backup client using SMO. The system is designed so that the user can manually configure where SQL Server stores its backups, by default its set to the Windows TEMP directory but the user can change that to whichever directory he desires.
The problem is SQL Server might not have access to that directory and I am not sure how to check if the selected directory is accessible by SQL Server.
Is there an SQL command/query that one can use to verify that SQL Server has access to a given location?