icacls to resolve "File/Directory is not readable"

I'm running Windows Server 2016 and attempting to grant a non-administrative user enough credentials to be able to run a script.

When I run this as the user in question, I get the error "File/Directory in not readable", as demonstrated in this screenshot:

That said, I've used the following icacls permissions:

icacls "D:\LogFiles" /grant DOMAIN\USER:(OI)(CI)RD

Open in new window

and I'm still getting the error.

Can someone please do a sanity check on this one for me? What should I be assigning to D:\LogFiles so that the folder and all subfolders are readable for copying?

TessandoIT AdministratorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NVITEnd-user supportCommented:
This gives Read and Execute...
icacls "D:\LogFiles" /grant DOMAIN\USER:(OI)(CI)(RX)

Open in new window

Of course, that assumes that USER is not in another right that blocks or restrict the same folder.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TessandoIT AdministratorAuthor Commented:
Thank you, NVIT. This is, however, now working and I'm getting the same error. Please note that it's not readable in the subfolder :

warning: Skipping file D:\LogFiles\reporting-images.domain.com\W3SVC14. File/Directory is not readable.

Open in new window

I was under the impression that:

OI is Object inherit, e.g. "This folder and files. (no inheritance to subfolders)" and
CI is Container inherit "This folder and subfolders"

There is no blocking or restrictions on this folder, btw. This includes the user in question.

What am I missing here?
NVITEnd-user supportCommented:
> ...it's not readable in the subfolder

But other sub files/folders are readable?
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

TessandoIT AdministratorAuthor Commented:
No, they are not. Sorry that wasn't clear. I just manually ran a sub-folder hard-coded to the script and it also gives me a "File/Directory is not readable." error as well.

Should I be logging out of the Command Prompt window in order for permissions to take or something?
TessandoIT AdministratorAuthor Commented:
I went ahead and listed permissions on the folder that I want to change. I'm not sure why there are two instances of the user (in this case, "scheduled_tasks" - which is the User I want to change. Maybe this will jar something:

Thanks again for your help.
TessandoIT AdministratorAuthor Commented:
I was able to fix this by first removing all previous permissions changes I made.

This was done using:

icacls  "D:\LogFiles"  /remove USER /T

I then was able to simply assign READ permissions and it worked as both the User and Scheduled Task:

icacls "D:\LogFiles" /grant DOMAIN\USER:R /T

Thank you for your help. :-)
NVITEnd-user supportCommented:
I'm glad you got it working... Yes. It can get confusing. As I first mentioned "...that assumes that USER is not in another right that blocks or restrict the same folder". And that, you found and figured out the fix for.

Happy Holidays!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2016

From novice to tech pro — start learning today.