0

After finally figuring out why I couldn't copy a particular file from a folder on the network (a permissions issue bought about by how the file was copied/moved into the folder in the first place - whatever it was, the permissions for the file were different from others in the same folder) - it struck me how difficult it seems to be to set the permissions for a file to be the same as another one.

Is there a quick way of setting the permissions for file A to be the same as those of file B in the same folder?

rossmcm
  • 1,576
  • 5
  • 34
  • 59
  • 2
    possible duplicate of [Copy security permissions of one file to another](http://superuser.com/questions/645097/copy-security-permissions-of-one-file-to-another) – Crippledsmurf Nov 28 '14 at 01:56
  • Almost a duplicate - the command-line examples given are for `icacls.exe` which isn't available for XP. The XP version `cacls.exe` doesn't seem to have the options to save and read the permissions from a text file. – rossmcm Nov 28 '14 at 23:38

1 Answers1

1

Assuming that you have Windows PowerShell installed the following commands in a PowerShell prompt should do what you want

In this example File A is the file with the permissions to copy, and file B is the file which should recieve the copied permissions.

Get-Acl -Path <path-to-file-a> | Set-Acl <path-to-file-b> 

I'm pretty sure PowerShell isn't installed by default on Windows XP. To get it you need to install both the .NET Framework 2.0 and the Windows Management Framework as described in this KB article.

Unfortunately I don't have a copy of Windows XP available to fully test, but I'm reasonably confident the information presented is relevant.

Crippledsmurf
  • 1,532
  • 11
  • 17