You could always restrict file types in the alias instead of the search folder definition. The problem, as I see it, is that previously launched .txt file is added to launch history which is then evaluated in later searches. But then it is filtered only by entered search string (and not by search folder definition) and is therefore not excluded from the results as it should be.
Alias:
^b (\w.*)[^\+]$
C:\aaa $$1 | dosearch +aaa -.txt $$1
Search directory:
path: C:\aaa
restrictions: url;jpg
modifier keyword: aaa