MapDrive

justmo

New member
Joined
Jul 31, 2006
Messages
1
Programming Experience
Beginner
Good morning
I am using vb.net 2005 and I have a piece of code which has been written in VB.net 2003 the code is
VB.NET:
Dim MD As New MapDrive.MapDrive
If Not MD.MapDrive("", pCSIIUNC, pCSIIUserName, pCSIIPassword) Then
LogMsg("Copy2CSII: Could not map network drive to " & pCSIIUNC)
End If
...
try
...
Catch
...
Finally
MD.UnMapDrive(pCSIIUNC)
End Try
In Error list I get Type 'MapDrive.MapDrive' is not defined how can I
fix this.And in future if I find myself in a similar situation where should I look
for new classes that substitude the old ones

Thanks for your help
mo
 
Last edited by a moderator:
I get the error "specified device not found" when using the code below. I have no problem mapping the drive from windows explorer.

Dim WSHn As New IWshRuntimeLibrary.WshNetwork
Try
WSHn.MapNetworkDrive("R", "\\Server\Data\Projects2\0102", False)

Catch Ex As Exception
MsgBox(Ex.Message)

End Try
 
I would try drive "R:" instead of "R".
 
WshNetwork object has got the RemoveNetworkDrive method that takes only the drive as parameter.
 
Back
Top