Changing permission of File in Windows 10

Kriti Mazumder
Kriti Mazumder used Ask the Experts™
on
I want to know what command in windows 10 is equivalent of CHMOD 400
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
icacls *.* /grant user:(RX,WDAC)

for further reading see ICACLS documentation
Kriti MazumderSenior Program Manager

Author

Commented:
icacls .\KP2.pem /grant:r Administrators:(RX,WDAC)
At line:1 char:45
+ icacls .\KP2.pem /grant:r Administrators:(RX,WDAC)
+                                             ~
Missing argument in parameter list.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingArgument
Kriti MazumderSenior Program Manager

Author

Commented:
above error i get.
however if i change the command as following snippet, it worked

icacls .\KP2.pem /grant:r Administrator:RX
processed file: .\KP2.pem
Successfully processed 1 files; Failed processing 0 files
Distinguished Expert 2018
Commented:
The reason your first try fails is because you do it on powershell and powershell does not like the comma. Do that on the ordinary shell (cmd.exe) and it will work. Icacls is a batch command and although most batch commands work on powershell, you can always run into this sort of problems, so either use batch or use the powershell equivalent of icacls: set-acl

Commented:
Zvitam's solution is the right solution. Mcknife helped the Author in implementing it.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial