Solved

check permissions in a local folder with with visual basic

Posted on 2011-09-28
1
191 Views
Last Modified: 2012-06-21
I would like to know how to check the permissions or rights in a local folder with visual basic.

for example

I had "c:\test", I would like to know what rights or permissions as this folder

0
Comment
Question by:altariamx2003
1 Comment
 
LVL 25

Accepted Solution

by:
Luis Pérez earned 500 total points
ID: 36813066
Imports System.IO
Imports System.Security.AccessControl
...

Dim folder As DirectoryInfo = New DirectoryInfo("c:\test")
Dim security As DirectorySecurity = folder.GetAccessControl()

'In this object, "security", you have a lot of information about access rules, audit rules, and so on about the folder.

'Check the MSDN documentation for the DirectorySecurity class and how to deal with it:
http://msdn.microsoft.com/en-us/library/system.security.accesscontrol.directorysecurity.aspx

Hope that helps.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

820 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