Click here to Skip to main content
15,900,378 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I am trying to attach my SQL Server DBs to instance of the server through code. It gives errr that the folder that contains these files does not hav 'Full Control' that I need to give by right clicking on the folder, and editing the Securities.

I wish to do it through code. Please advise if it is possible using Netsh command or any other way.

Thanks
Posted

the easiest way to do it "trough code" is by using SetACL.exe command tool[^]. It has countless number of command line options and allows to set the security permissions on files and folders. Trusted by system administrators as well (it is used in our company)
 
Share this answer
 
Does your MSSQLSERVER service account has proper privilege on the folder? Please check and give proper permission if does not exists. Then you will be able to do that, I hope.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900