Solved

Directory.CreateDirectory

Posted on 2010-08-19
1
453 Views
Last Modified: 2012-08-14
Using the above method of Directory.CreateDirectory(Path, Security). How can I retrieve the security from one directory and place it or copy it another?
0
Comment
Question by:thenrich
1 Comment
 
LVL 29

Accepted Solution

by:
nffvrxqgrcfqvvc earned 500 total points
ID: 33477488
You can use GetAccessControl to return DirectorySecurity about one directory and then use that in your call to CreateDirectory.
The example below obtains the security from the folder C:\Test then creates a new directory with the same security named C:\Test2

Dim dirSecurity As System.Security.AccessControl.DirectorySecurity = System.IO.Directory.GetAccessControl("c:\test")

System.IO.Directory.CreateDirectory("c:\test2", dirSecurity)

Open in new window

0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 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

22 Experts available now in Live!

Get 1:1 Help Now