dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
390
share rss forum feed


jaa
Premium
join:2000-06-13
kudos:2
Reviews:
·Optimum Online
·Vonage

[WIN7] Retaining file permissions

If I move a file from one folder to another, it seems to retain the original file permissions.

If I copy a file from one folder to another, it seems to get the file permissions from the folder it was copied to.

The problem is moving files to a public folder - it seems other users do not have access to the file if it came from a private folder they did not have access to.

Is there a way around this to a move is more like a "copy" and then a "delete"?
--
NOTHING justifies terrorism. We don't negotiate with terrorists. Those that support terrorists are terrorists.


dave
Premium,MVM
join:2000-05-04
not in ohio
kudos:8
Reviews:
·Verizon FiOS

The difference in behaviour is explained by it being 'a new file' versus 'the same file'.

Being a lazy man, I'd go for 'copy and delete'.

Unless you do this often and/or with very large files. In which case, perhaps icacls filename /reset does what you need.



jaa
Premium
join:2000-06-13
kudos:2
Reviews:
·Optimum Online
·Vonage
reply to jaa

If it were me, that is what I would do.

Is there a simple command that will apply the folder permissions to all subfolders and files? I could just run that hourly to fix the permissions.

Would this work if I created a cmd file and "run as administrator"?

cd \myfolder
icacls *.* /reset /T

Reset to inherited permission for all files, folders, and subfolders?

If I do that by going to the security of "my folder" and go to advanced, and then tell it to replace the permissions on subfolders, I get a denied error because I am not the owner (I am an administrator).
--
NOTHING justifies terrorism. We don't negotiate with terrorists. Those that support terrorists are terrorists.


dave
Premium,MVM
join:2000-05-04
not in ohio
kudos:8
Reviews:
·Verizon FiOS

"Would this work"?

Probably - but you can test it out by running a command prompt as administrator and then typical that exact same command sequence.

(Btw, '*.*' is oldthinkful - we can just say '*' these days, since dot is more-or-less just a character like any other).


dave
Premium,MVM
join:2000-05-04
not in ohio
kudos:8
Reviews:
·Verizon FiOS
reply to jaa

By the way, icacls is not going to change the ownership of files moved in, only the protection. Is this important to you? Do you need standard ownership?

icacls /setowner or
takeown

should do the trick (the two have slightly different semantics).