Is there some way I can get the file permissions for a folder or a file extracted to a file with some command in windows?

for instance:

dir ??? > permissions.txt

If you have at least windows 2003 sp2, then you can use icacls.exe:

icacls.exe [file|folder] > file.txt 

you enter file or folder without the brackets, in case it is not clear enough. If you have something older, then you can use setacl, which is a wonderful little tool, but a bit complicated to get started with.

| improve this answer | |
  • interesting. I found a flag "/save" which formats it very wierd. Do you know how to interpret that information? I got something like this: D:AI(A;ID;FA;;;BA)(A;ID;FA;;;SY)(A;ID;0x1200a9;;;BU)(A;ID;0x1301bf;;;AU) – Default Nov 6 '10 at 13:36
  • that is used to save and restore acls. No idea how to interpret it. If you just need to see the permissions on the cli, do not use any switch, just use the file or folder as only argument. – natxo asenjo Nov 6 '10 at 13:59

secaudit/ntfs-3g.secaudit can extract the ACLs from a filesystem object.

| improve this answer | |
  • I guess I'll have to download that. Is there some built-in way? – Default Nov 6 '10 at 12:28
  • Dunno. I don't use Windows much. – Ignacio Vazquez-Abrams Nov 6 '10 at 12:28
  • hehe :) is it possible with a unix command (for reference)? – Default Nov 6 '10 at 12:34
  • That would be ntfs-3g.secaudit. – Ignacio Vazquez-Abrams Nov 6 '10 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.