Convert a file path to a UNC path

Category:
Network/Internet
Type:
Snippets
Difficulty:
Advanced
Author:
Waty

Version Compatibility:

More information:
This funciton converts a reference to a file or a directory in the standard Windows format (e.g. "H:\MySubDir") to the corresponding UNC format (e.g. \\MyMachine\MyDir\MySubDir"). This is useful when a program running on a workstation has to pass a file or directory reference to another app running on another workstation or when the reference should be stored in a database for use from every application on the network.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: