Does a means exist, ideally in or from VBA (directly or via Win32, PowerShell, VBS, or CMD call), to programmatically return / get the Windows share name containing either (a) the working directory; or (b) a fully qualified file name?
The objective is to provide networked users (for current purposes, on the same local subnet and without Active Directory) with a string permitting them to access the file in question, e.g., something like
\ServerNameShareNamepathtoFileName.ext
It’s easy enough to obtain both the computer name and the local URI for the file but the share name element has been elusive. The difficulty is that the obtainable local URI makes reference only to the local filesystem, beginning with a drive letter, e.g.,
.DriveLetter:pathtoFileName.ext
, which of course is meaningless to network users.
Note that the share may be of the containing directory or a superdirectory any number of levels higher.
Any thoughts, including general thoughts regarding approach, on whether and how this might be done would be most appreciated.