Has anyone found out how to connect to a networkshare under Vista? I created a tool which connects to networkshares and it works fine in XP, but it won't work in Vista...
I found the following procedure on the forums:
Code: Select all
Procedure WNetAddConnection(UserName.s,Password.s,ShareName.s,DriveLetter.s,Persistant.l)
;/ Username / Password
;/ Sharename : \\Server\Share
;/ DriveLetter : F:
;/ Persistant : #True or #False
;/ Return 1 if success or 0 if fail
lpNetResource.NETRESOURCE
lpNetResource\dwType=1 ; RESOURCETYPE_DISK
lpNetResource\lpLocalName=@DriveLetter
lpNetResource\lpRemoteName=@ShareName
OpenLibrary(0,"Mpr.dll")
Retour=CallFunction(0,"WNetAddConnection2A",lpNetResource,Password,UserName,Persistant)
CloseLibrary(0)
If Retour=0 : Retour=1 : Else : Retour=0 : EndIf
ProcedureReturn Retour
EndProcedure
Can anyone help me out here???