I copied the script from msdn
Option Explicit
Dim sFileName, sFilePath
sFileName = "*.pst"
sFilePath = "U:\"
Dim oFS 'file system object
Set oFS = WScript.CreateObject("Scripting.FileSystemObject")
FindFile sFilePath, oFS
Sub FindFile(path, fso)
Dim oFC 'file collection object
Dim oFolder 'folder object
Dim eFile 'file element
Dim eFolder 'folder element
Set oFC = fso.GetFolder(path)
For Each eFile In oFC.Files'
If eFile.Name = sFileName Then
'echo file path
WScript.Echo eFile.Path
End If
Next
Set oFolder = oFC.SubFolders
'recursion starts here
For Each eFolder In oFolder
FindFile eFolder.Path, fso
Next
End Sub
I would like to first search in the c:\ than in the u:\. When I did the
search I got an error Access denied and The script stopped. I would like to
skip the file and keep going.