Get a Relative Path

Category:
Files and Directories
Type:
Snippets
Difficulty:
Intermediate

Author: johannes kutsam

Version Compatibility: Visual Basic 6

More information:
Pass two path strings to this function an it will return the th first path relative to the second. For example,

get_relative_path "C:\My Documents", "C:\Windows\System"

returns ../../My Documents/

always pass folder strings NEVER file strings

If the folder is a drive like c:\ you have to pass it without a backslash.

Updated 1/20/2001. Now written in English and documented.

for further questions: johannes_kutsam@yahoo.com, Austria

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

Declarations:

Code: