Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using cacls with VBS to set folder permissions

Posted on 2009-05-08
5
Medium Priority
?
1,188 Views
Last Modified: 2013-11-25
Hi,

I'm trying to incorporate setting folder permissions on a newly created folder into a .vbs file but having problems with the syntax as the domain groups I'm trying to add both have spaces in the names and use some non alpha numeric characters.

I can get the below script to work with certain groups but when trying to add the group below (with an * in the name) it doesnt set the permissions and I want to add multiple groups with Domain\authenticated users being another one.  

set Objtest=CreateObject("WScript.Shell")
Objtest.run "cacls \\Server\projects\fusion\public /E /G Domain\*Fusion_TL:M", 7, True

Can someone tell me where I'm going wrong and also explain the correct format for adding or changing the permissions for multiple groups.

Thanks.
0
Comment
Question by:barryhiggins3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 14

Expert Comment

by:rejoinder
ID: 24339267
As far as I know, you cannot have a wildard in the group/user area, only the folder/file area.
http://support.microsoft.com/default.aspx/kb/162786
"You can specify more than one file, user, or group in a command. Wildcard characters in file and directory names are supported."
I think the above quote means you can name multiple people (using the full names etc) while the folder or files can use the wildcard.
0
 
LVL 4

Author Comment

by:barryhiggins3
ID: 24339415
Thanks,

I dont actually want to use a wild card, I'm specifying the exact  the group names they contain the asterix * character.
0
 
LVL 14

Expert Comment

by:rejoinder
ID: 24339580
As a test can you try this...
Objtest.run "cacls \\Server\projects\fusion\public /E /G ""Domain\*Fusion_TL"":M", 7, True
This way the domain and group name are enclosed in quotes and might be looked at as text rather than a wildcard.
0
 
LVL 4

Author Comment

by:barryhiggins3
ID: 24340099
I ran the test. No luck I'm afraid, it didnt apply the permissions.
0
 
LVL 4

Accepted Solution

by:
barryhiggins3 earned 0 total points
ID: 24340618
I've managed to figure it out.

The If I use the pre windows 2000 logon name instead for the group that works.

The following applies the permissions for multiple groups including the one causing the problem.

Objtest.run "cacls \\Server\projects\fusion\public /E /G ""NT AUTHORITY\Authenticated Users"":R ""Domain\_Fusion_TL"":M", 7, True
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

721 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