You can take a look at this post: File type search
Please note that searching through a lot of folders like this can be very costly and should not really be done in relevance within fixlets/tasks/baselines/analyses. If you are just looking for a quick relevance statement to troubleshoot something in the relevancedebugger you can use something like:
pathnames whose (exists match (regex "(\.exe$)|(\.txt$)" ) of it) of descendants of root folders of drives
But again, it’s not recommended to use this within the platform at all. Better approaches are outlined in the link above.
(Note: the statement above takes over a minute to evaluate in my relevance debugger -> it would take the client 50 times longer)