Declare Function NetDfsAddStdRoot Lib "netapi32" _
(ByVal s1 As String, ByVal s2 As String, _ ByVal s3 As String, flags As Long) As Long Servername = "\\tim" ' Server containing the root rootShare = "testdfs" ' existing root share Comment = "" ' Optional comment x = Module1.NetDfsAddStdRoot(StrConv(Servername, vbUnicode), _ StrConv(rootShare, vbUnicode), StrConv(Comment, vbUnicode), 0) 'x=0 if everything went OK Assumes: netapi32.dll must be present. |