'Option Compatible Sub pattern_examples ExampleDir("*") ' results in 9 directories /Windows ExampleDir("*E*") ' no directories found /Windows ExampleDir("*e*") ' results in 8 directories /Windows ExampleDir("?e?i?e*") End Sub Sub ExampleDir(pattern$) 'CompatibilityMode(True) ' Displays all files and directories Dim sPath As String Dim sDir As String, sValue As String sDir="Directories:" sPath = CurDir sValue = Dir$(sPath + getPathSeparator + pattern,16) Do If sValue <> "." And sValue <> ".." Then If (GetAttr( sPath + getPathSeparator + sValue) And 16) >0 Then ' Get the directories sDir = sDir & chr(13) & sValue End If End If sValue = Dir$ Loop Until sValue = "" MsgBox sDir,0,sPath 'CompatibilityMode(False) End Sub