Home All Groups Group Topic Archive Search About

Directory Local or Network

Author
25 Feb 2009 6:41 PM
AGP
Im looking for an API that will tell me if a directory actually resides on
the local disk or a network server. The directory could be in any format
c:\myfolder\
z:\networkfolder\
\\big\newfolder\
\\c$\subfolder\
\\agg\oldfolder\ {where this maps to a local disk}

I've been looking at some API but cant figure out which one to use.

tia
AGP

Author
25 Feb 2009 7:15 PM
Karl E. Peterson
AGP wrote:
Show quoteHide quote
> Im looking for an API that will tell me if a directory actually resides on
> the local disk or a network server. The directory could be in any format
> c:\myfolder\
> z:\networkfolder\
> \\big\newfolder\
> \\c$\subfolder\
> \\agg\oldfolder\ {where this maps to a local disk}
>
> I've been looking at some API but cant figure out which one to use.
>
> tia
> AGP

--
..NET: It's About Trust!
http://vfred.mvps.org
Author
25 Feb 2009 7:16 PM
Karl E. Peterson
Hmmm, last one got away.  Anyway...

AGP wrote:
> Im looking for an API that will tell me if a directory actually resides on
> the local disk or a network server.

This help?

   Ask the VB Pro, January 2000
   http://vb.mvps.org/articles/ap200001.asp

--
..NET: It's About Trust!
http://vfred.mvps.org
Author
27 Feb 2009 4:06 AM
AGP
That seems to only work with paths of the type C:\folder\ but not
\\agg\folder\.

AGP

Show quoteHide quote
"Karl E. Peterson" <k***@mvps.org> wrote in message
news:%23QwOS23lJHA.4520@TK2MSFTNGP03.phx.gbl...
> Hmmm, last one got away.  Anyway...
>
> AGP wrote:
>> Im looking for an API that will tell me if a directory actually resides
>> on
>> the local disk or a network server.
>
> This help?
>
>   Ask the VB Pro, January 2000
>   http://vb.mvps.org/articles/ap200001.asp
>
> --
> .NET: It's About Trust!
> http://vfred.mvps.org
>
Author
27 Feb 2009 7:06 AM
C Kevin Provance
"AGP" <sindizzy.***@softhome.net> wrote in message
news:kAJpl.12920$8_3.9766@flpi147.ffdc.sbc.com...
| That seems to only work with paths of the type C:\folder\ but not
| \\agg\folder\.
|
| AGP

You could try mapping your network drives?
Author
28 Feb 2009 12:13 AM
AGP
Wqell this isnt a mapping utility. It simply collections info for a certain
folder and i need to check if that folder is on a local drive or on anetwork
drive. It is input by the user.

AGP

Show quoteHide quote
"C Kevin Provance" <BillMRapedMySh***@.netblows.ms> wrote in message
news:uAJtxnKmJHA.4448@TK2MSFTNGP05.phx.gbl...
>
> "AGP" <sindizzy.***@softhome.net> wrote in message
> news:kAJpl.12920$8_3.9766@flpi147.ffdc.sbc.com...
> | That seems to only work with paths of the type C:\folder\ but not
> | \\agg\folder\.
> |
> | AGP
>
> You could try mapping your network drives?
>
>
Author
3 Mar 2009 12:37 AM
Karl E. Peterson
AGP wrote:
>> Hmmm, last one got away.  Anyway...
>>
>> AGP wrote:
>>> Im looking for an API that will tell me if a directory actually resides
>>> on the local disk or a network server.
>>
>> This help?
>>
>>   Ask the VB Pro, January 2000
>>   http://vb.mvps.org/articles/ap200001.asp
>
> That seems to only work with paths of the type C:\folder\ but not
> \\agg\folder\.

Okay, help me understand the problem here.  You can't tell if that, a
fully-qualified UNC share, is local or remote?  Really?

   Private Function CurrentMachineName() As String
      Dim Buffer As String
      Dim nLen As Long
      Const NameLength = CNLEN + 1
      Buffer = Space$(NameLength)
      nLen = Len(Buffer)
      If GetComputerName(Buffer, nLen) Then
         CurrentMachineName = Left$(Buffer, nLen)
      End If
   End Function

If Instr(1, Unc$, "\" & ComputerName & "\", vbTextCompare) = 2 Then  'Doh!
--
..NET: It's About Trust!
http://vfred.mvps.org