Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check if user has write permissions for a folder

Status
Not open for further replies.

k. Ahnung

Programmer
Sep 23, 2016
1
0
0
DE
Hi all,
Using VB.Net 2005:

I am trying to find out in code if the currently logged on Windows user (application is not elevated) has write permissions to a specific folder, in particular, "c:\Windows".

I have been trying to use FileIOPermission() but just cannot seem to make it work.

I thought something like this may work, but it always returns 'TRUE':

Dim fp As New FileIOPermission(FileIOPermissionAccess.Write, "C:\windows\")
MsgBox(SecurityManager.IsGranted(fp))

Thank you in advance!
 
See whaat happens when you test against [tt]Program Files[/tt] or [tt]Program Files(x86)[/tt] or possibly [tt]System Volume Information[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top