i have used the following code to map a network drive
VB Code:
Public Function m_mapDrive(LocalDrive As String, _ RemoteDrive As String, Optional UserName As String, _ Optional Password As String) As Boolean 'Example: 'MapDrive "Q:", "\\RemoteMachine\RemoteDirectory", _ '"MyLoginName", "MyPassword" Dim NetR As NETCONNECT NetR.dwScope = RESOURCE_GLOBALNET NetR.dwType = RESOURCETYPE_DISK NetR.dwDisplayType = RESOURCEDISPLAYTYPE_SHARE NetR.dwUsage = RESOURCEUSAGE_CONNECTABLE NetR.lpLocalName = Left$(LocalDrive, 1) & ":" NetR.lpRemoteName = RemoteDrive m_mapDrive = (WNetAddConnection2(NetR, UserName, Password, _ CONNECT_UPDATE_PROFILE) = 0) End Function
that code works ok if i use it in win2000 Os but when i tried in a win98 Os. I get the following:
say i pass as a RemoteDrive drive the following path "\\machineName\dir1\dir2" i would expect to a new drive starting at dir2 (win2000 behaviour) but it maps a drive starting at dir1 which is the name of the shared directory of machineName
is there a work around?
thnks




Reply With Quote