Solved

Using cacls with VBS to set folder permissions

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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

810 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