Hi
For a remote way of doing it if you can use the admin share (c$), take
a look here for a starting point:
http://groups.google.com/groups?selm=3FE2371C.6E5E6DE9%40hydro.com
For a local version, here is a starting point:
Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
strProfilesDirectory = "" 'init value
strProfilesDirectory = objShell.RegRead("HKLM\SOFTWARE\Microsoft\" _
& "Windows NT\CurrentVersion\ProfileList\ProfilesDirectory")
On Error Goto 0
If strProfilesDirectory = "" Then
' The ProfilesDirectory registry value didn't exist,
' parsing the "Common Start Menu" path read from registry instead
strCSMpath = objShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\" _
& "CurrentVersion\Explorer\Shell Folders\Common Start Menu")
' Remove the "\All Users\Start Menu" part of it
strProfilesDirectory = Left(strCSMpath, Len(strCSMpath) -21)
End If
strProfilesDirectory = objShell.ExpandEnvironmentStrings(strProfilesDirectory)
WScript.Echo "Users profile folders:" & vbCrLf
' enumerate the folders
Set objFolder = objFSO.GetFolder(strProfilesDirectory)
For Each objFldr In objFolder.SubFolders
WScript.Echo objFldr.Path
Next
--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter