- 1 year ago
icacls /deny (de and d) doesn''t work
The icacls
command is used to manage permissions on files and directories in Windows. The /deny
option is used to deny specific permissions to a user or group. It seems like you're having trouble using the /deny
option. Here's the correct syntax for using icacls
to deny permissions:
batchicacls "C:\Path\To\Directory" /deny "Username:(DENY,DE)"
Replace "C:\Path\To\Directory"
with the path to the directory you want to apply the deny permission to, and "Username"
with the actual username you want to deny access to. The (DENY,DE)
after the username specifies that both the "Delete" (DE
) and "Delete Subdirectories and Files" (DE
) permissions should be denied.
For example, to deny delete permissions for the user "User123" on the "C:\MyFiles" directory, you would use:
batchicacls "C:\MyFiles" /deny "User123:(DENY,DE)"
Make sure you run the command prompt as an administrator when using icacls
, as modifying permissions requires administrative privileges. Also, be very careful when using deny permissions, as they can cause unexpected issues if not used correctly.