here is some code I use to create a batch file on a users desktop with all of the drive mappings, that aside you will be able to see the code for the drive and root bit, devicetype=3 is a network share
Private Sub MapMyDrives_Click()
'****
' Function to create a batch file to write the users current network drives to.
' this can be used by the user to create the file on their desktop so when they
' login using VPN the drives can be mapped in a faster way than a full login
'
' Author Jim Ward
' Creation 10th April 2008
'
'****
'****
' Declare what we need, general
'****
Dim fs, d, dc, l, n, s
'****
' Declare what we need to get the Desktop location
'****
Dim oWSS As Object
Const szlocation As String = "Desktop"
Dim szDesktopPath As String
'****
' get the desktop location
'****
Set oWSS = CreateObject("WScript.Shell")
szDesktopPath = oWSS.SpecialFolders(szlocation)
'****
' get the list of drives
'****
Set fs = CreateObject("Scripting.FileSystemObject")
Set dc = fs.Drives
s = ""
'****
' Process each one, ignoring local drives
' For each network drive (type=3) write a line to a BAT file
'****
Open szDesktopPath & "\MapMyDrives.BAT" For Output As #1
For Each d In dc
If d.DriveType = 3 Then
l = UCase(d.DriveLetter)
n = UCase(d.ShareName)
' s = s & "NET USE " & l & ": " & n & vbCrLf
Print #1, "NET USE " & l & ": " & n
ListBox1.AddItem "NET USE " & l & ": " & n
End If
Next
Close #1
End Sub