Checking for File/Directory Permissions

N

Nigel

Chip Pearson kindly provided the following code to check read/write access
attributes for files, which works great. How do I check for file and
directory permissions in an NTFS network file system?

In my company network I need to check if the user has full control or at
least modify permission to read/write and delete files and/or directories.
Before my VBA programs try to take specific actions.


' code from C Pearson Jan 2007
Dim Attr As Long
Attr = GetAttr("\\DellLapTop\MainDrive\Temp")
If Attr And vbReadOnly Then
Debug.Print "Folder is read-only"
Else
Debug.Print "Folder is read-write"
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top