Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

adding rights to a few files

I have a program that will not run unless the user has admin rights to five files in the windows directory c:\windows

I want to set the domain users or the local users group so that they will have admin rights to all five of these files.  I figured there was some switches i can use with the net localgroup command but im not sure.  Let us assume that the files are file1, file2, file3, file4 and file5 all in the windows directory.  Let us also assume that the domain is named mydomain.  I have the ability to push the script out i just need to know a script that will run.  So basically if the script will work from a local machine it will work accros my domain.  Any help would be appreciated.
  • 2
1 Solution
Lee W, MVPTechnology and Business Process AdvisorCommented:
You need to use CALCS or XCALCS.

cacls filename /e /c /g "domain users:F"
hartnessjrAuthor Commented:
could you expand on that leew?  what do the switches do  and what is the :F for .. along with will i need to do one of these lines for each file.. such as

cacls c:\windows\file.txt /e /c /g "domain users:F"

Lee W, MVPTechnology and Business Process AdvisorCommented:
Just type cacls /? - all information on usage is there.

In short:

/e - edit the ACLs instead of defaultly replacing them
/c - continue on error
/g - grant "domain users:F[ull Control]"

ACLs = Access Control Lists

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now