I want the BrowseForFolder dialog to start at the domain. I can get it to start at "My Network Places" no problem, but under Windows 2000 you still have to drill thru Entire Network -> Microsoft Windows Network -> MyDomain. I can get the domain name with Environ$("USERDOMAIN"). Is there a way I can get the pidl of that, or set the dialog to start there so the list of computers is immediately presented?

Thanks.

VB Code:
  1. Public Function BrowseForComputer(hwnd As Long) As String
  2.     Dim bi As BROWSEINFO
  3.     Dim retval As Long
  4.     Dim pidl As Long
  5.    
  6.     'get the pidl of "My Network Places"
  7.     retval = SHGetSpecialFolderLocation(hwnd, CSIDL_NETWORK, pidl)
  8.    
  9.     If retval <> 0 Then
  10.         Debug.Print "Couldn't get network pidl."
  11.         BrowseForComputer = ""
  12.         Exit Function
  13.     End If
  14.    
  15.     With bi
  16.         .hwndOwner = hwnd
  17.         .pidlRoot = pidl
  18.         .pszDisplayName = String$(MAX_PATH, vbNullChar)
  19.         .lpszTitle = "Browse for Computer" & vbNullChar
  20.         .ulFlags = BIF_BROWSEFORCOMPUTER
  21.     End With
  22.    
  23.     retval = SHBrowseForFolder(bi)
  24.    
  25.     If retval <> 0 Then
  26.         BrowseForComputer = Replace(bi.pszDisplayName, vbNullChar, "")
  27.     Else
  28.         BrowseForComputer = ""
  29.     End If
  30.    
  31.     Call CoTaskMemFree(pidl)
  32.  
  33. End Function