Q:

How to grant a read-only access to a directory to a user on the command line?

I am trying to grant a read-only access to my temp directory to another user from the command line using icacls.exe. 
Tried the following (PowerShell):

icacls.exe $env:TEMP /grant mydom\user:R
icacls.exe $env:TEMP /grant 'mydom\user:(GR)'
icacls.exe $env:TEMP /grant 'mydom\user:(GR,X)'
icacls.exe $env:TEMP /grant mydom\user:F

No matter what I try when I check the permissions I get the same picture:

The user is added to the list of the users - fine, but it shows no permissions.
So, what is the right way to do it? Using icacls is not necessary, any  command line way is fine.

A:

You could try setting the permissions by hand. Next you run the command 'icacls [folderpath]'. It shows what permissions the user has. You can reuse that syntax.

