Does anyone know what I need to change to the below so that it searches H:\ and all its subfolders?
"start_folder="H:\" Set objFSO = CreateObject("Scripting.FileSystemObject") Set olkApp = CreateObject("Outlook.Application") Set objFolder = objFSO.GetFolder(start_folder) For Each objFile In objFolder.Files If LCase(objFSO.GetExtensionName(objFile.Name)) = "pst" Then WScript.Echo "Found PST:" & objFile.Name olkApp.Session.AddStore objFile.Path End If Next"
I've looked into traverse etc. but I'm sure there's something better suited.
In this instance it probably is fine to do so, but every-time I have been involved in a project that requires CygWIn as a dependency, most recently with my current client, it has resulted in an unbelievable headache when building the project in a continuous integration environment (in this case TeamCity running on Windows Server 2012) or on mac dev machines. Otherwise I would agree, find is a very simple solution to the given problem, and if OP is will to do all this in a linux environment or willing to use the linux subsystem for windows, still a viable and elegent solution.