Solved

Using cacls with VBS to set folder permissions

Posted on 2009-05-08
5
1,184 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

726 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