**-- Set up API calls Declare Integer WNetCancelConnection In WIN32API String lpName,short lForce Declare Integer WNetAddConnection In WIN32API ; string lpRemoteName, ; string lpPassword, ; string lpLocalName Local lcRemotePath, lcLocalPath, lnResult lcRemotePath = "\\W0028109792\DATAWARE" lcLocalPath = "R:" *Add connection lnResult = WNetAddConnection(m.lcRemotePath, 0, m.lcLocalPath) Do Case Case lnResult = 0 && OK Wait Window timeout 3 'Connected ' Case lnResult = 85 && Already assigned Wait Window timeout 3 'Already assigned' Case lnResult = 1202 && Already assigned to other path Wait Window timeout 3 'Assigned to other path' *Remove connection Wait Window timeout 3 'Disconnecting...' WNetCancelConnection(m.lcLocalPath,0) *Reassign lnResult = WNetAddConnection(m.lcRemotePath, 0, m.lcLocalPath) If lnResult = 0 && OK Wait Window timeout 3 'Connected' else Wait window 'Error #'+ltrim(str(m.lnResult)) Endif EndcaseCetin