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?

2
  • 2
    possible duplicate of Copy security permissions of one file to another Nov 28, 2014 at 1: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, 2014 at 23:38

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .