I use the following code to layout network drives on a system. I want to add a third column for persistence but in vb.net I do not know how to check if a drive has a persistent map or not. Any suggestions?
For Each drive_info As DriveInfo In DriveInfo.GetDrives()
If drive_info.DriveType().ToString = "Network" Then
With maps.Items.Add(drive_info.Name)
.SubItems.Add(drive_info.DriveType().ToString)
End With
End If
Next drive_info
You could have always done it in WMI without any (well okay fewer) nasty cludges.
e.g.
Obviously you need to add a reference to System.Management.dll and change Z: to the drive you are checking, or you could probably replace all your code with just that snippet as removing the WHERE clause will return all mapped drives.