UNC Path From a Path Referencing a Mapped Network Drive

Category:
Files and Directories
Type:
Snippets
Difficulty:
Intermediate
Author:
Anonymous

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
This is a function that shells the NET USE command as a quick and easy means of converting a path that refers to a mapped network drive into a proper UNC path. This could also be achieved using APIs but its very long winded to do it that way - kind of like reinventing the wheel.

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

Declarations:

Code: