Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Local or Network Drive? 1

Status
Not open for further replies.

lameid

Programmer
Jan 31, 2001
4,212
US
Does anybody know of a way to determine if a drive is a mapped network drive or a local drive?
 
Thanks, both of you.

I went for the scripting method PHV referenced... I feel like my code will eventually not work when I explicitly use dll's.

Anyway a begining translation of the code to VBA...

Code:
Sub ListNetworkDirves()
    Dim WSH As Object
    Dim oDrives As Object
    Dim i As Integer
    Set WSH = CreateObject("WScript.Network")
    Set oDrives = WSH.EnumNetworkdrives
    For i = 0 To oDrives.Count - 1 Step 2
        Debug.Print oDrives.Item(i) & " = " & oDrives.Item(i + 1)
    Next i
End Sub

From there any VBA programmer should be able to retask it.
Seems like a good way to start for remaping all connections to UNC paths... Not something I was looking to do, but nice none the less.
 
Right hand is faster than the left... I hate those transpostions---> ListNetworkDirves vs ListNetworkDrives
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top