none
How to get "Network Path" of a given folder in VBA (value "network path" in tab "Sharing" in the properties of a folder) RRS feed

  • Question

  • All

    Let's assume you have a server named "SRV".
    The server contains a disk "D:\" with some shared subfolders.
    One of those folders is "D:\DATA\SAFETY" which you have shared as "SAFETY" meaning you can access it by using "\\SRV\SAFETY"

    Now, in the folder SAFETY there is a folder PROCUDERES.  So the full path on the server is "d:\DATA\SAFETY\PROCEDURES"
    If I use Windows explorer and I get the properties of this folder "PROCEDURES" there is a tab "Sharing" with a value "network path" which contains value "\\SRV\SAFETY\PROCEDURES".  How can I get that network path in VBA?

    So I need a VBA-function "GetNetworkpath" where the parameters are "the servername" and "full path on the server" and the result is the full network path (thus in our example "\\SRV\SAFETY\PROCEDURES")

    strNetworkPath=GetNetworkPath("SRV", "d:\data\safety\procedures")

    private function GetNetworkPath(strServername as string, strFolder as string) as string

    ...

    end function

    Regards

    Kris







    • Edited by kvhoof Monday, October 21, 2019 9:18 AM
    Monday, October 21, 2019 9:11 AM

All replies