Declare Function WNetAddConnection Lib "mpr.dll" Alias "WNetAddConnectionA" (ByVal _
lpszNetPath As String, ByVal lpszPassword As String, ByVal lpszLocalName _
As String) As Long
Declare Function WNetGetConnection Lib "mpr.dll" Alias "WNetGetConnectionA" _
(ByVal lpszLocalName As String, ByVal lpszRemoteName As String, cbRemoteName _
As Long) As Long
Declare Function WNetCancelConnection Lib "mpr.dll" Alias "WNetCancelConnectionA" _
(ByVal lpszName As String, ByVal bForce As Long) As Long
Dim Caminho As String, Unidade as String
Caminho = "ComputadorCaminho"
Unidade = "I:"
'Realiza conexão
WNetAddConnection Caminho , "Se tiver senha, digite á aqui", unidade
'Consulta caminho de uma determinada conexão, _
'neste caso, na variável caminho será armazenado o local do caminho _
'atual ref. a unidade
WNetGetConnection Unidade, Caminho, 255)
'Desconecta
Copiado do artigo daqui da vbweb
vlu//