Too advanced or too long? Bryce did the job. You just have to know what you put in and what it returns.
Do not forget to add the DirPlus() UDF
 Code:
If NOT @LOGONMODE
	Break On
Else
	Break Off
EndIf
Dim $RC

$RC = SetOption("Explicit", "On")
$RC = SetOption("NoMacrosInStrings", "On")
$RC = SetOption("NoVarsInStrings", "On")
$RC = SetOption("WrapAtEOL", "On")

Dim $Path, $Directory, $Item
$Path = "H:\foldername\"
$Directory = DirPlus($Path)
For Each $Item in $Directory
	If InStr($Item, $Path + "File") AND Right($Item,3) = "CMD"
		; Do stuff here
	EndIf
Next