Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A utility to reset permissions and rights to folders and files? 1

Status
Not open for further replies.

mysteryn11

IS-IT--Management
Nov 11, 2003
19
0
0
NO
Does anybody know of a tool or utility that can totally reset all permissions and rights to a folder and sub-folders. I have a problem that some files and folders give error messages when trying to reset all permissions and child permissions, and stop the reset of permissions to their children. I need a program that can just 'zap' a whole folder structure back to "everyone" or "administrator".

P.S. The files that cause crashes are temporary system files for example "thumbs.db" and "pspbrowse" etc.
 
Hi there

Have you had a look at XCACLS, which is a command line you can use to set/reset file and folder permissions? I've used it in the past when creating servers to set initial permissions on folders, but can't see any reason why it couldn't be used for replacing existing permissions with new ones. Not sure how it deals with files it can't change permissions on, but am sure there is a parameter which skips these sorts of files and carries on.

You DO, however, have to define the permissions you want to set before you start (you'd normally generate a batch file script to run)

The command help gives the following information
Displays or modifies access control lists (ACLs) of files

XCACLS filename [/T] [/E] [/C] [/G user:perm;spec] [/R user [...]]
[/P user:perm;spec [...]] [/D user [...]] [/Y]
filename Displays ACLs.
/T Changes ACLs of specified files in
the current directory and all subdirectories.
/E Edit ACL instead of replacing it.
/C Continue on access denied errors.
/G user:perm;spec Grant specified user access rights.
Perm can be: R Read
C Change (write)
F Full control
P Change Permissions (Special access)
O Take Ownership (Special access)
X EXecute (Special access)
E REad (Special access)
W Write (Special access)
D Delete (Special access)
Spec can be the same as perm and will only be
applied to a directory. In this case, Perm
will be used for file inheritence in this
directory. If not omitted: Spec=Perm. Special values
for Spec only:
T NoT Specified (for file inherit,
only for dirs valid)
At least one access right has to follow!
Entries between ';' and T will be ignored!

/R user Revoke specified user's access rights.
/P user:perm;spec Replace specified user's access rights.
for access right specification see /G option
/D user Deny specified user access.
/Y Replace user's rights without verify

Wildcards can be used to specify more that one file in a command.
You can specify more than one user in a command.
You can combine access rights.



As always, be extremely careful with this tool, not least as I suspect you're going to be doing a replace *.* from the root of your C drive! This tool can give you massive problems if you get it wrong (such as replacing existing access rights when you merely wanted to modify some of the existing ones and leave the others intact!) However, for your purposes, I suspect this will do what you need.


Think its part of the Resource Kit, but you can almost certainly find just the .exe file somewhere and use that.

hope this helps

edlcsre
 
Thanks for an excellent informed post! Have a star.
;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top