Can you help? Or have a better way to do this?
Code: Select all
#dllMPR = 1
If OpenLibrary(#dllMPR,"MPR.DLL")
maptype.s = "RESOURCETYPE_DISK"
drivelet.s = "H:"
drivepath.s = "\\server"
folder.s = "\test123"
path.s = drivepath + folder
password.s = ""
username.s = ""
core.s = maptype + " " + drivelet + " " + path
profile.s = "CONNECT_UPDATE_PROFILE"
; Disconnect drive letter first just in case
error.l = CallFunction(#dllMPR,"WnetCancelConnection2",drivelet ,profile ,1)
; map Drive letter to corrct place
dummy.l = CallFunction(#dllMPR,"WNetAddConnection2",core, password,username, profile)
Else
MessageRequester("Info","MPR.DLL not found",0)
EndIf
MessageRequester("Worrking", "Finished correcly",0)
End