Home All Groups Group Topic Archive Search About

relative file path to absolute?

Author
11 Oct 2005 3:04 AM
Russ
Hi:  I'm writing VB6 code and I need to be able to be given a relative
file path (e.g. "N:\UserDir\somefile.txt" and turn it into an absolute
path (e.g. "\\DumServer\folder1\somefile.txt").

Easy way to do that?

russ

Author
11 Oct 2005 3:13 AM
Someone
Translating a Mapped Drive to a UNC Path
http://vbnet.mvps.org/index.html?code/network/uncfrommappeddrive.htm


Show quoteHide quote
"Russ" <rwpatter***@tva.gov> wrote in message
news:1128999883.152961.322350@g43g2000cwa.googlegroups.com...
> Hi:  I'm writing VB6 code and I need to be able to be given a relative
> file path (e.g. "N:\UserDir\somefile.txt" and turn it into an absolute
> path (e.g. "\\DumServer\folder1\somefile.txt").
>
> Easy way to do that?
>
> russ
>
Author
11 Oct 2005 10:35 PM
Karl E. Peterson
Russ wrote:
> Hi:  I'm writing VB6 code and I need to be able to be given a relative
> file path (e.g. "N:\UserDir\somefile.txt" and turn it into an absolute
> path (e.g. "\\DumServer\folder1\somefile.txt").
>
> Easy way to do that?

See http://vb.mvps.org/samples/UncName

The problem is, of course, that multiple mappings may be in place for a given drive.
IOW, there may be no _one_ correct answer to this question.
--
Working Without a .NET?
http://classicvb.org/petition
Author
12 Oct 2005 11:05 AM
Dave
Karl

Surely that's only a problem going in the other direction, no matter how
many mappings there are of different parts of a given disc, the root UNC
path will be the same.

BTW I though "relative path" referred to a path with respect to the selected
one, not a mapped one.

Best Regards
Dave O.

Show quoteHide quote
"Karl E. Peterson" <k***@mvps.org> wrote in message
news:uqueaRrzFHA.1252@TK2MSFTNGP09.phx.gbl...
> Russ wrote:
>> Hi:  I'm writing VB6 code and I need to be able to be given a relative
>> file path (e.g. "N:\UserDir\somefile.txt" and turn it into an absolute
>> path (e.g. "\\DumServer\folder1\somefile.txt").
>>
>> Easy way to do that?
>
> See http://vb.mvps.org/samples/UncName
>
> The problem is, of course, that multiple mappings may be in place for a
> given drive.
> IOW, there may be no _one_ correct answer to this question.
> --
> Working Without a .NET?
> http://classicvb.org/petition
>
>
Author
12 Oct 2005 10:06 PM
Karl E. Peterson
Yeah, I get those twisted about at times.  You may be right.  Thanks!


Dave wrote:
Show quoteHide quote
> Karl
>
> Surely that's only a problem going in the other direction, no matter
> how many mappings there are of different parts of a given disc, the
> root UNC path will be the same.
>
> BTW I though "relative path" referred to a path with respect to the
> selected one, not a mapped one.
>
> Best Regards
> Dave O.
>
> "Karl E. Peterson" <k***@mvps.org> wrote in message
> news:uqueaRrzFHA.1252@TK2MSFTNGP09.phx.gbl...
>> Russ wrote:
>>> Hi:  I'm writing VB6 code and I need to be able to be given a
>>> relative file path (e.g. "N:\UserDir\somefile.txt" and turn it into
>>> an absolute path (e.g. "\\DumServer\folder1\somefile.txt").
>>>
>>> Easy way to do that?
>>
>> See http://vb.mvps.org/samples/UncName
>>
>> The problem is, of course, that multiple mappings may be in place
>> for a given drive.
>> IOW, there may be no _one_ correct answer to this question.
>> --
>> Working Without a .NET?
>> http://classicvb.org/petition

--
Working Without a .NET?
http://classicvb.org/petition