Public Const STYPE_DISKTREE = 0 'Share uses Public Const SHI_USES_UNLIMITED = -1& 'Share Access Public Const ACCESS_READ = &H1 Declare Function NetShareAdd Lib "netapi32.dll" (ByVal _ servername As String, ByVal Level As Long, LPBYTE As Any, _ lpParm_Err As Long) As Long Type SHARE_INFO_2 ShI2_NetName As String ShI2_Type As Long ShI2_Remark As String ShI2_Permissions As Long ShI2_Max_Uses As Long ShI2_Current_Uses As Long ShI2_Path As String ShI2_Passwd As String End Type Function ShareAdd(ByVal sServerName As String, ByVal _ sShareName As String, ByVal sPathName As String) As Boolean Dim pserver() As Byte, pShareName() As Byte, psharepath() As Byte Dim ShareInfo As SHARE_INFO_2 Dim lsserver As String Dim iParamError As Long, llreturn As Long If sServerName = "" Then pserver = UCase(sServerName) + vbNullChar Else ' if it is not passed; use local machine lsserver = vbNullChar End If If sShareName = "" Then ShareAdd = False Exit Function Else pShareName = sShareName + vbNullChar End If If sPathName = "" Then ShareAdd = False Exit Function Else psharepath = sPathName + vbNullChar End If ShareInfo.ShI2_NetName = pShareName(0) ShareInfo.ShI2_Type = STYPE_DISKTREE ShareInfo.ShI2_Remark = vbNullChar ShareInfo.ShI2_Permissions = 0& ShareInfo.ShI2_Max_Uses = SHI_USES_UNLIMITED ShareInfo.ShI2_Current_Uses = 0 ShareInfo.ShI2_Path = psharepath(0) ShareInfo.ShI2_Passwd = vbNullChar llreturn = NetShareAdd(pserver(0), 2, ShareInfo, iParamError) If llreturn = 0 Then ShareAdd = True Else ShareAdd = False End If NetAPIBufferFree (iParamError) End FunctionYou have to have the access rights to create the share for the specified path.