icacls problem
Moderator: DosItHelp
icacls problem
Hi
I have Windows 10 v1511 Enterprise 64 bit.
I noticed that the icacls "<Home_directory_path>" /inheritance:e /T /L command, applied to the home directory of a directory structure, is run only the first level of the structure. Why?
How do I run it automatically in all the levels below?
Thanks
Bye
I have Windows 10 v1511 Enterprise 64 bit.
I noticed that the icacls "<Home_directory_path>" /inheritance:e /T /L command, applied to the home directory of a directory structure, is run only the first level of the structure. Why?
How do I run it automatically in all the levels below?
Thanks
Bye
Last edited by balubeto on 22 Jan 2016 09:44, edited 1 time in total.
-
- Posts: 82
- Joined: 30 Dec 2013 10:16
- Location: United States by the big waterfall
Re: icacls problem
I'd throw in a /C and see if you are getting errors.
Re: icacls problem
Matt Williamson wrote:I'd throw in a /C and see if you are getting errors.
I tried but I get the "access denied" error. Why?
Thanks
Bye
Re: icacls problem
balubeto wrote:Matt Williamson wrote:I'd throw in a /C and see if you are getting errors.
I tried but I get the "access denied" error. Why?
Thanks
Bye
Are you running the cmd prompt or batch file as Administrator by right clicking on it first and choosing Run as administrator?
Re: icacls problem
Squashman wrote:balubeto wrote:Matt Williamson wrote:I'd throw in a /C and see if you are getting errors.
I tried but I get the "access denied" error. Why?
Thanks
Bye
Are you running the cmd prompt or batch file as Administrator by right clicking on it first and choosing Run as administrator?
I open the command prompt run as administrator and write the icacls "<Home_directory_path>" /inheritance:e /Q /T /C /L command.
I also noticed that if I write the icacls "<Home_directory_path>" /reset /Q /T /C /L command, it goes in a loop. Why? What should I write in order to avoid this?
Thanks
Bye
Last edited by balubeto on 22 Jan 2016 09:59, edited 2 times in total.
Re: icacls problem
balubeto wrote:I open the command prompt run as administrator and write the icacls "Home_directory" /inheritance:e /Q /T /C /L command.
You sure about that. When you run cmd.exe as administrator it defaults the working directory to C:\windows\system32>.
So based on your information, you have a folder named Home_Directory located in C:\windows\system32>.
Re: icacls problem
Squashman wrote:balubeto wrote:I open the command prompt run as administrator and write the icacls "Home_directory" /inheritance:e /Q /T /C /L command.
You sure about that. When you run cmd.exe as administrator it defaults the working directory to C:\windows\system32>.
So based on your information, you have a folder named Home_Directory located in C:\windows\system32>.
I corrected the previous posts as I had mistyped.
Thanks
Bye
Re: icacls problem
Apparently, the commands
reach my goal but the third command goes in loop and, to stop it, I have to press Ctrl+C. Why?
How do I do that the third command does not go in loop?
Thanks
Bye
Code: Select all
takeown /F "<Home_directory_path>" /A /R /D S /SKIPSL
icacls "<Home_directory_path>" /reset
icacls "<Home_directory_path>" /reset /Q /C /T /L
pushd "<Home_directory_path>" && ( rd /S /Q "<Home_directory_path>" 2>nul & popd )
reach my goal but the third command goes in loop and, to stop it, I have to press Ctrl+C. Why?
How do I do that the third command does not go in loop?
Thanks
Bye
Re: icacls problem
For now, the only solution that I found is
but I am sure that there is another better but I can not find it.
Someone would be able to find it?
Thanks
Bye
Code: Select all
takeown /F "<Directory_Path>" /A /R /D S /SKIPSL >nul 2>&1
icacls "<Directory_Path>" /reset
icacls "<Directory_Path>" /reset /Q /C /T /L >nul 2>&1
pushd "<Directory_Path>" && ( rd /S /Q "<Directory_Path>" 2>nul & popd )
but I am sure that there is another better but I can not find it.
Someone would be able to find it?
Thanks
Bye
Re: icacls problem
I hope that someone might find a solution better than mine because my solution is too slow because the third command does not stop to analyze my directory structure but the entire contents of the hard disk. Why?
Out of curiosity, what are the SIDs of the TrustedInstaller or Authenticated Users or System users so that I can try to remove them with the /remove:g option of the icacls command?
Thanks
Bye
Out of curiosity, what are the SIDs of the TrustedInstaller or Authenticated Users or System users so that I can try to remove them with the /remove:g option of the icacls command?
Thanks
Bye
Re: icacls problem
I think I found the best solution to remove a directory structure which also contains symbolic links and with ACLs managed by TrustedInstaller or Authenticated Users or System users:
Many thanks to all
Bye
Code: Select all
takeown /F "<Directory_path>" /A /R /D Y /SKIPSL >nul 2>&1
icacls "<Directory_path>" /reset
icacls "<Directory_path>" /grant:r Administrators:(OI)(CI)F /inheritance:e /Q /C /T /L >nul 2>&1
pushd "<Directory_path>" && ( rd /S /Q "<Directory_path>" 2>nul & popd )
Many thanks to all
Bye