i have used the following code to map a network drive
VB Code:
  1. Public Function m_mapDrive(LocalDrive As String, _
  2.   RemoteDrive As String, Optional UserName As String, _
  3.   Optional Password As String) As Boolean
  4.  
  5. 'Example:
  6. 'MapDrive "Q:", "\\RemoteMachine\RemoteDirectory", _
  7. '"MyLoginName", "MyPassword"
  8.  
  9.    Dim NetR As NETCONNECT
  10.  
  11.    NetR.dwScope = RESOURCE_GLOBALNET
  12.    NetR.dwType = RESOURCETYPE_DISK
  13.    NetR.dwDisplayType = RESOURCEDISPLAYTYPE_SHARE
  14.    NetR.dwUsage = RESOURCEUSAGE_CONNECTABLE
  15.    NetR.lpLocalName = Left$(LocalDrive, 1) & ":"
  16.    NetR.lpRemoteName = RemoteDrive
  17.  
  18.    m_mapDrive = (WNetAddConnection2(NetR, UserName, Password, _
  19.        CONNECT_UPDATE_PROFILE) = 0)
  20.    
  21.    
  22. 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