11

Is there a tool or command which will compare two directory trees on separate computers and output a list of differences, including differences in permissions?

I was looking at http://winmerge.org/ and it didn't seem to have this feature (it seems to compares file sizes and contents, but not attributes). Took a look through the options, but didn't see a setting to change this.

I've had some problems in the past with permissions getting messed up on some driver directories after an update and it would nice to compare a working installation with a broken one.

StackzOfZtuff
  • 1,842
  • 13
  • 21
Sam
  • 2,020
  • 1
  • 16
  • 22

5 Answers5

5

Have you throught about using PowerShell to do this?

PS2 includes a cmdlet Get-ACL which enums the NFTS permissions (including owner) for a given folder/file.

StackzOfZtuff
  • 1,842
  • 13
  • 21
commandbreak
  • 1,009
  • 5
  • 6
  • Yes, I did think about Powershell - but had hoped not to use it. I don't use it often enough to get comfortable with it. – Sam Feb 03 '10 at 15:26
2

You can use ICACLs.exe, Included since Vista or so to dump the permissions to a text file. Then use WinDiff or Beyond Compare, or whatever your favorite file comparison tool is, to see the differences.

Example icacls command line:

icacls C:\Folder1 /T > Folder1.txt
Mr. Smythe
  • 643
  • 1
  • 8
  • 13
1

Can't find anything that will perform a "diff" on file permissions in Windows, but I do know that RoboCopy and Richcopy (http://technet.microsoft.com/en-us/magazine/2009.04.utilityspotlight.aspx?pr=blog) will copy files while preserving NTFS attributes like permissions.

Cory J
  • 1,568
  • 5
  • 19
  • 28
0

I highly recommend setacl. It is a free tool you can obtain from helgeklein.com.

To compare two directories I did this:

  • Make a list of all ACLs in both folders
  • List in a text format by:
    setacl -ot file -on FolderA -actn list -lst "f:tab" > AclsFolderA.txt  
    setacl -ot file -on FolderB -actn list -lst "f:tab" > AclsFolderB.txt
    
  • Compare the 2 lists. I do this with diff from CygWin:
    diff AclsFolderA.txt AclsFolderB.txt
    

I had a problem with comparing two user folders. These folders needed to have identical ACLs except for the user who owned the folder.
I solved this by replace the username in the ACL with a common name customer. This allowed me to compare the ACL without having an obvious difference on the username itself.

Eddie C.
  • 535
  • 1
  • 3
  • 12
Cie6ohpa
  • 231
  • 1
  • 6
0

Try dedicated tools

Probably it worthwile to look at:

Notes:

  • 1st one can scan folder tree & produce permission report which can be saved in Excel (having 2 reports you can do comparison in Excel),
  • 2nd can copy permissions...

Unfortunately these 2 are not free, and not do exactly what you want but may be helpful for your task...

AFAIK there are no off-the-shelf tool which can easily & conveniently do NTFS permissions comparison/copy, despite existing demand :)

Mikhail
  • 1,295
  • 3
  • 19
  • 35