?
Solved

Using CACLS to set file / folder permissions to subfolders and files only

Posted on 2009-02-20
6
Medium Priority
?
2,096 Views
Last Modified: 2012-05-06
I am attempting to do some automatic folder creation on our server via some VBA programming. I am using the CACLS command to set the proper permissions. The thing I cannot figure out is how to using CACLS to set permissions to only subfolders and files - and not the actual folder that I am changing the permissions of. At the folder creation, I am not placing any documents in the folder, just creating the folder, setting permissions (or trying to) and that's it. I am using the following command:

Shell("CACLS " & """" & DirectoryPathIP & """" & " /e /g Domain\Group:C", vbHide)

I realize you can get a DISPLAY of what permissions are effecting by using the CACLS command - the (IO) and all that jazz - but is there any way to set this by CACLS or any other method?
0
Comment
Question by:Gssc1414
  • 3
  • 3
6 Comments
 
LVL 3

Author Comment

by:Gssc1414
ID: 23712660
Anyone have any ideas?
0
 
LVL 11

Expert Comment

by:darrenmcwi
ID: 23718270
Try looking into XCACLS.VBS which you can donload from microsoft. It gives you the same options as going through the UI.
0
 
LVL 3

Author Comment

by:Gssc1414
ID: 23720762
darrenmcwi,

I actually did check out xcacls.vbs - It works when I type the command into the cmd prompt manually, but when i do it via code, I get a "File not found" error everytime.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 11

Accepted Solution

by:
darrenmcwi earned 2000 total points
ID: 23730097
The VBScript needs to exist someplace. Hard code the apth to the XCACLS.VBS file and see if that helps.

The other possibility is that you need to call the VBS as an arguement from CSCRIPT like this example I'm doing from a batch file...

cscript "\\%SERVER%\map\xcacls.vbs" "C:\MAP" /E /F /S /G Everyone:F;F

Open in new window

0
 
LVL 11

Expert Comment

by:darrenmcwi
ID: 23897147
Gssc1414,

Did you still need assistance with this issue? Let us know and we'll try to help out.
0
 
LVL 3

Author Comment

by:Gssc1414
ID: 23914578
darrenmcwi,

I am not sure if I implimented your solution directly, but I was able to perform what I needed by simply calling a batch file and passing the path of the directory in which I wanted to set the permissions to the batch file. For some reason I could not get it to work inside of VBA, but I am not too worried about it.

Thanks for your help, and sorry about the delay in points - I have been pretty busy and actually forgot about it.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

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

This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
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…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

571 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