I have tried this:
Dim CurrentPath as String = "C:\TestPath"
Dim UserName as String = system.environment.usernam
Dim dInfo As New DirectoryInfo(CurrentPath)
Dim dSecInfo As DirectorySecurity = dInfo.GetAccessControl(Acc
Dim myRuleValue As Integer = 0
myRuleValue = FileSystemRights.FullContr
Dim myRule as FileSystemAccessRule
myRule = New FileSystemAccessRule(UserN
dSecInfo.AddAccessRule(myR
dSecInfo.SetAccessRule(myR
dInfo.SetAccessControl(dSe
but it fails because it is not giving permission for the function to set the rule. Any ideas on how to set the rule as administrator???
Main Topics
Browse All Topics





by: CraigLazarPosted on 2009-04-06 at 08:11:39ID: 24078134
Hi,
I think the machine must have admin writes in order to install applications especially any adjustments to the registry. Most installs effect the registry,