Somebody can help me on how to map a network drive. I already posted this question but nobody answered me directly. The O.S. that I going to map is Win 2000 with the username: Admin; password: Companyname; path:\\192.168.0.70. Please help me!![]()
I have a code found given by other members here.
I found this but still doesn't work.
VB Code:
Private Declare Function WNetAddConnection Lib "mpr.dll" Alias "WNetAddConnectionA" (ByVal lpszNetPath As String, ByVal lpszstrPassword As String, ByVal lpszLocalName As String) As Long Dim strLocalDriveLetter As String Dim strPassword As String Dim strNetworkPathName As String strLocalDriveLetter = "Z:" 'Local drive letter to be mapped strPassword = "" 'specify network password if required strNetworkPathName = "\\NEWPATH\NEWPATH" 'path to network drive If WNetAddConnection(strNetworkPathName, strPassword, strLocalDriveLetter) > 0 Then MsgBox ("An Error occurred mapping the drive") Else MsgBox ("Drive successfully mapped!") End If
My question in this code is where I gonna put my username?
I'm new in VB, please help me out this. tnx




Reply With Quote