Add or Remove NTFS Permissions via Command Line

· Windows Scripts

One neat feature of scripting is the ability to make changes to a large number of objects at one time. The script below shows how to modify the NTFS permissions on a folder from the command prompt. Copy and paste the command a bunch of times and you’ve got your automation! I suggest using CACLS /? to look up each of the parameters before using to ensure you are not replacing certain required permissions. Place the code in a *.CMD file to execute.

@ECHO OFF

REM Remove EngineeringTeam access from the directory
CACLS "C:\Program Files\Adobe" /T /E /R EngineeringTeam

REM Give change access to the EngineeringTeam group
CACLS "C:\Program Files\Adobe" /T /E /G EngineeringTeam:C
author image

About Joseph Spurrier

I'm passionate about building solutions to automate tasks and improve efficiency. I worked for a few companies in the digital healthcare space. My education is in forensics. Tech guy. Traveler. Runner. Guitar player. Scotch and beer enthusiast. GitHub LinkedIn Twitter Google+

Share this post


Comments powered by Disqus