Click to See Complete Forum and Search --> : How to obtain Relative path from Absolute path?


July 14th, 1999, 02:50 AM
Hi,

How do I obtain the relative path (e.g. "..\..\Test.tmp" ) from the absolute path ( "C:\Test.tmp" ) with respect to a directory (e.g. C:\Temp2\Dir2 )? This should work irrespective of where the file Test.tmp is stored.
Do you have any sample code which could help me do this?

Any help would be greatly appreciated.

Thanks and Regards,
SN

FredStone
February 5th, 2005, 11:57 PM
PathRelativePathTo

JeffB
February 6th, 2005, 12:40 PM
Not sure PathRelativePathTo is exactly the function you need, but you can see an example here:

http://www.freevbcode.com/ShowCode.asp?ID=6137

JeffB