Declare Function NetDfsRemove Lib "netapi32" _
(ByVal DFSEntryPath As String, _ ByVal ServerName As String, _ ByVal ShareName As String) As Long DFSEntryPath = "\\tim\testdfs\xxx" ' Full path of DFS link, including server and root share ServerName = "TIM" ' contrary To docu without leading \\! ShareName = "newfolder" ' Without Server or leading nor tailing \ x = Module1.NetDfsRemove(StrConv(DFSEntryPath, vbUnicode), _ StrConv(ServerName, vbUnicode), StrConv(ShareName, vbUnicode)) ' x=0 if everything went OK Returns: 0 if everything went OK, or Win32 API error code Assumes: netapi32.dll must be present. |