Questions tagged [icacls]

Windows command that displays or modifies discretionary access control lists (DACLs) on specified files, and applies stored DACLs to files in specified directories. Inheritor of the older CACLS command.

Useful links:

  1. iCACLS on technet.
  2. iCACLS on SS64 help pages.
99 questions
1
vote
1 answer

Getting intermittent "Access is Denied" exception when accessing a file after changing the permissions on windows

Getting intermittent "Access is Denied" while accessing a file after changing the permission using icacls on windows. Details : Please refer to the script which has been run as administrator. import os for x in range(50): #this exe will check…
1
vote
2 answers

Can't remove ACL entry that refers to orphaned SID

I’m (still) running Win-7 Home Premium. I understand the risks and, for a number of reasons, still DO NOT want to upgrade to Win-10 or to rebuild my win-7 installation to correct this problem. The system was built 8 years ago and, over the years,…
Chucko
  • 81
  • 1
  • 8
1
vote
0 answers

Using ICACLS to only allowing Administrator to access a folder. All other users to be denied access

I need only Administrators to be able to access a particular folder. None other than Administrator should be able to access that folder. This has to be achieved using icacls command. I have used the following command after surfing the net but since…
1
vote
1 answer

How do ICACL permissions map to FileSystemRights

I'm writing a script to copy permissions from one directory structure and reapply them to another. I can't simply use icacls \\my\path\* /save file.acl /T as I need to make a number of tweaks between the save and the restore, for which it's simpler…
JohnLBevan
  • 22,735
  • 13
  • 96
  • 178
1
vote
0 answers

Why does icacls show different permissions for C: root directory depending on from which folder I run it?

When I run icacls to check permissions for my C: root directory, the result differs depending on from which folder I run the command. Why is that? Examples: Running it from C: C:\>icacls "C:" C: BUILTIN\Administratörer:(OI)(CI)(F) NT…
Spenen
  • 11
  • 1
1
vote
1 answer

Batch File looping until certain text is displayed

Currently have a batch file for replacing NTFS permissions using the takeown and icacls commands, i have added these commands to a loop and it works great. Is there a way to exit the loop when a certain response is displayed? like "Failed processing…
Mark Mckie
  • 13
  • 4
1
vote
1 answer

Powershell ICACLS to change permissions on a file

Basically what I'm trying to do is push a txt file out to a list of remote PCs and then change the permissions on that file for the local users group to only have read and execute. (I gave up trying to push the file out while retaining permissions).…
DJS1789
  • 11
  • 1
  • 2
1
vote
0 answers

icacls Command - What am I doing wrong?

I am trying to grant calltake1 access to all existing files within this CallRecorder\calls directory I have tried using this script: C:>icacls "C:\Users\calltake1\Documents\CallRecorder\calls" /grant calltake1:(OI)(CI)/F /T and I keep getting…
Sam
  • 11
  • 1
1
vote
1 answer

Cant delete certain folders with powershell

I have a problem when i want to delete profilefolders on a network share. There seems to be a problem with certain folders that cant be deleted. Here is the code, which work fine on most folders: Import-Module -Name…
Michael Kirkegaard
  • 379
  • 1
  • 3
  • 14
1
vote
1 answer

Set Folder Permission with icacls

I am embarrased that I have to ask this, but as the syntax of icacls apparently has changed in powershell, I seem to be unable to assemble a working command. What I am trying to do: I want to remove all permissions from a specific folder and then…
LPanic
  • 82
  • 1
  • 9
1
vote
1 answer

Use of icacls in a batch file (brackets issue)

I need to copy a folder to a list of PC's to a specific location - and then make that folder Full Control to Everyone and have it inherited to all sub folders and files. I create a txt file with the list of PC's in and then include this in a bat…
sjw
  • 33
  • 4
1
vote
1 answer

Change permission of all files with specific extension in a folder and subfolders using CMD

How to change permission of all files with extension .pyc in a folder and its sub-folder? individually it will be like this: c:\folder1> cacls *.pyc /P everyone:F c:\folder1\a> cacls *.pyc /P everyone:F c:\folder1\b> cacls *.pyc /P everyone:F and…
1
vote
3 answers

calling windows' icacls from python

I've used successfully subprocess.check_output to call plenty of windows programs. Yet, I'm troubled at calling icacls. By cmd, this works: cmd>icacls "C:\my folder" /GRANT *S-1-1-0:F I've…
glezo
  • 742
  • 2
  • 9
  • 22
1
vote
3 answers

icacls broken in brackets

This is actually working but not in the format I prefer. The code below will achieve what I want. Makes a folder in any writable standard User Profile (I am aware it wont work in some system profiles like Default etc.) that some software needs and…
Tika9o9
  • 405
  • 4
  • 22
1
vote
1 answer

icacls C:\Users\%username%\AppData\Local\Mozilla\updates /q /c /t /deny users:F

I want to deny permission to mentioned folder for current user to access,modify,read. Using icacls. icacls C:\Users\%username%\AppData\Local\Mozilla\updates /q /c /t /deny users:F But i am getting error "The system cannot find the path…