IanR Posted January 20, 2005 Share Posted January 20, 2005 Just wondered if anyone has suggestions for ways of setting the permissions when creating a folder on an NTFS volume from within a script? (To complicate matters slightly this would also have to work across a network as a non-Admin user.) If it says "Made in China" then it just might be made by slave labour... Link to comment Share on other sites More sharing options...
sugi Posted January 20, 2005 Share Posted January 20, 2005 It doesn't matter if you're admin or not to set permissions. If you have the permission to change the permissions you can do it. If you don't have permission you cannot do it even as an admin. The admin only has a way to reset these permissions. Also you don't have to care if it's local or remote. Only point when you're working remote: The share and directory permissions must grant you the permission to change them.Your best bet is to use cacls.exe or xcacls.exe as command line tools provided by Microsoft (AFAIR cacls ships with NT4+) after creating the directory. Link to comment Share on other sites More sharing options...
IanR Posted January 20, 2005 Author Share Posted January 20, 2005 Your best bet is to use cacls.exe <{POST_SNAPBACK}>I was thinking along those lines, reason I asked was mainly in case I'd overlooked a way of implementing it without resorting-to a command-prompt. (although that would be OK in fact as it only has to be done once per run, to one folder, so it would have negligible performance-impact.) Other option might be a DLL-call, I guess. Have to check Technet to see what the call is, and if it's feasible. If it says "Made in China" then it just might be made by slave labour... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now