change permissions

Who is the DOS command line expert? Or is there another way to do what I need, maybe a SQL script? From inside a program I want to change permissions on a directory and all the files in it, say d:\psoft\payroll\files. The program will be running under the service account but I want to grant access to an individual user id "abcdefg". Can I use the chmod command (chmod 600 d:\psoft\payroll\files)? If so, I don't remember userid being a part of the parameter list for that command. How do I set permissions for a specific user?
LVL 1
Dennis MillerAsked:
Who is Participating?
 
Steve KnightIT ConsultancyCommented:
Oops, with CACLS at the beginning of that line, i.e.

CACLS d:\psoft\payroll\files /e /t /g  abcdefg:F

/e Adds your choice to the existing ACL for the directory
/t All files and subdirectories too
/g grant permissions to the following user object (specify as domain\user if a domain user)

Steve
0
 
Steve KnightIT ConsultancyCommented:
Assuming a command prompt within windows 200x then you need to use the cacls command.

e.g.

d:\psoft\payroll\files /e /t /g  abcdefg:F

to give full control or change the F to a C to add as change.  This will be inherited down from that point on W2K/2003/XP

hth

Steve
0
 
SteveGTRCommented:
Can you use the cacls.exe command?

Maybe something like this:

cacls d:\psoft\payroll\files /G: abcdefg:R

Good Luck,
Steve
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
cwwkieCommented:
You can also use xcacls from the resource kit. For example the command
     XCACLS d:\psoft\payroll\files /E /T /G abcdefg:F
will give the user abcdefg full control to d:\psoft\payroll\files and all subdirectories.

see for more information http://www.ss64.com/nt/xcalcs.html

xcacls has some more possibilities setting rights over cacls.
0
 
SteveGTRCommented:
Didn't see your post dragon-it. Please ignore my post.
0
 
Steve KnightIT ConsultancyCommented:
Thanks for the points & grade.  Boy do you have to be quick in this T/A, lucky I suppose, was just passing !!

Steve
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.