Opens every folder on the drive the script is run from, that contains a file filename. May use wildcards like *.cmd or *.txt. It only accepts one argument. filename
It opens the folder and waits until the window is closed to do the next Loop.
Edit: prompts for filename if none on command line. Enter just a filename, no drive or path (e.g. readme.txt)
if 0 < 1
InputBox,filename,,Enter File Name with no path
filename = %1%
tmp := A_ScriptDir
FilePat := drive filename
tmp := _FileDir(A_LoopFileLongPath)
;MsgBox, 8256, Test, %A_LoopFileLongPath%`n%tmp%
edit: I removed the "#notrayicon" so it can be killed via tray icon to break the loop. Also note that it waits until a window with the title that matches the folder name no longer exists. If you happen to have the same folder already open, it will hang. So close all explorer windows before running, or fix the script.