[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

change permissions

Posted on 2006-03-29
6
Medium Priority
?
15,052 Views
Last Modified: 2011-08-18
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?
0
Comment
Question by:Dennis Miller
  • 3
  • 2
6 Comments
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16326941
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
 
LVL 43

Accepted Solution

by:
Steve Knight earned 2000 total points
ID: 16326961
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
 
LVL 30

Expert Comment

by:SteveGTR
ID: 16326978
Can you use the cacls.exe command?

Maybe something like this:

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

Good Luck,
Steve
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 14

Expert Comment

by:cwwkie
ID: 16326988
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
 
LVL 30

Expert Comment

by:SteveGTR
ID: 16327002
Didn't see your post dragon-it. Please ignore my post.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16327056
Thanks for the points & grade.  Boy do you have to be quick in this T/A, lucky I suppose, was just passing !!

Steve
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question