Set Windows Permissions using a batch file

I used this when for some reason a SQL Server Database would lose its permissions daily.

Create a batch file .e.g Change Permissions.bat with the following inside it.

cacls “D:\YOUR DIRECTORY PATH” /t /e /c /g “USERNAME – If its a Domain User domain\user”:F

Change your path and username you wish to add permissions to.

Please note: The above command pushes the permission to ALL files and folders below your given path.

Leave a Comment

Your email address will not be published.


Get every new post on this blog delivered to your Inbox.

Join other followers: