Link to home
Start Free TrialLog in
Avatar of nickladdha
nickladdha

asked on

how to get full access permission in vb.net application

Dim Target As DirectorySecurity = Directory.GetAccessControl("c:\test", AccessControlSections.All)
        'Dim NewRule As FileSystemAccessRule
        Dim NewRule As FileSystemAccessRule
        'NewRule = New FileSystemAccessRule(New NTAccount("MachineName\Account"), FileSystemRights.FullControl, AccessControlType.Allow)
        NewRule = New FileSystemAccessRule(New NTAccount("MachineName\Account"), FileSystemRights.FullControl, AccessControlType.Allow)
        Target.AddAccessRule(NewRule)

        Directory.SetAccessControl("c:\test", Target)
        MsgBox("successfully")

i am execute this code for full access permission then display the exception

[The process does not possess the 'SeSecurityPrivilege' privilege which is required for this operation.]

how to solve this error.
Avatar of HawyLem
HawyLem

You need to adjust your security privileges, using this api:
http://msdn.microsoft.com/en-us/library/aa375202(v=vs.85).aspx

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of rowansmith
rowansmith

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nickladdha

ASKER

Incomplete