Solved

Modifying folder permissions by command or batch file

Posted on 2008-11-02
10
952 Views
Last Modified: 2012-05-05
I have several computers where the users are not administrators. I recently found out that in order to user a new product these users need to have modify access to 3 folders on the local C drive of their machine. I have ghost solution suite so I have the ability to run batch files remotely on their machines.

I think the easiest way to accomplish what I need to do is just grant the Everyone group modify access to these folders. Is this possible using the command line or a batch file.

Lets assume the folder we need to modify permissions on  is c:\myprogram.
0
Comment
Question by:Joseph Daly
  • 5
  • 4
10 Comments
 
LVL 2

Accepted Solution

by:
m3tech earned 500 total points
ID: 22864140
There are cleaner ways to do this in a domain, but since you didn't mention one, try the following command:

cacls c:\myprogram\*.* /t /e /g everyone:F

This command will change the permissions to all files in c:\myprogram and all subdirectories and files (/t argument), editing permisions instead of replacing (/e argument) and granting (/g argument) everyone full control.

Please test this before applying. Type cacls alone in a cmd prompt for more info.
0
 
LVL 77

Expert Comment

by:Rob Williams
ID: 22864144
You can use xacls.exe within a batch file to modify NTFS permissions if this helps you, but but for the recod it doesn't affect share permissions.
http://support.microsoft.com/kb/318754
0
 
LVL 2

Expert Comment

by:m3tech
ID: 22864148
I just re-read your post use "everyone:C" to grant "change" permissions instead of full control.
0
 
LVL 2

Expert Comment

by:m3tech
ID: 22864153
Please note that xCacls.exe is a Windows 2000 version of cacls.exe that must be downloaded. cacls.exe is installed with windows and should always be available.
0
 
LVL 35

Author Comment

by:Joseph Daly
ID: 22864168
M3tech: I just took a look at the /? for CACLS.exe and it looks like what you gave me up there will work. Im gonna wait until tomorrow morning when I get into work to test it but if it works the points are all yours.

Thanks
0
Too many email signature changes to deal with?

Are you constantly being asked to update your organization's email signatures? Do they take up too much of your time? Wouldn't you love to be able to manage all signatures from one central location, easily design them and deploy them quickly to users. Well, you can!

 
LVL 2

Expert Comment

by:m3tech
ID: 22864187
No hurry, let me know if there are any problems. Incidentally, this same command will let you take permissions/ownership of ntfs drives/folders in XP home without requiring a reboot into safe mode (my primary use for it :p)
0
 
LVL 35

Author Comment

by:Joseph Daly
ID: 22867027
Ok so I just tried this this morning and I ran into some problems here is what I did.

1. Created a new folder on my local C drive called test.
2. The folder looks like it inherited the default permissions
3. I ran the command "cacls c:\test\*.* /t /e /g users:F"
4. Checked the folder permissions and they did not change.

The batch file looks like it complete successfully and didnt return any errors however the security did not change. I have attached a screenshot of the folder permissions below. Now it looks like it changed the permissions on the files within the folder but I also need the ability to change it on the folder itself.
1.jpg
0
 
LVL 35

Author Comment

by:Joseph Daly
ID: 22867240
Actually I think I might have it. I changed the CACLS command to.

"c:\test /t /e /g users:F" and it looks like it did it.
0
 
LVL 35

Author Closing Comment

by:Joseph Daly
ID: 31512566
Awesome answer. Exactly what I needed.
0
 
LVL 2

Expert Comment

by:m3tech
ID: 22873781
I'd have to play with the commands myself, although I see where your problem came into play with the example I gave and it looks like that your code may fix the issue.

If you find it doesn't, you could always add another calcs.exe command to your batch file and process the folder and files/subdirectories seperately. Not clean, but eh.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now