Your command is looking for a Shared Drive named filename.txt, not what you're looking for.
The process in more complicated; you have to search by user. GAMADV-XTD3 6.07.26 or later is required.
gam config auto_batch_min 1 multiprocessexit rc=0 redirect stdout - multiprocess redirect stderr stdout all users print filelist query "name='filename.txt'" fields id,name,driveid filepath corpora alldrives
config auto_batch_min 1- Do parallel processing
multiprocessexit rc=0 - Stop processing when the file is found
redirect stdout - multiprocess redirect stderr stdout - Make the progress messages clean
all users - Look at everybody
print filelist query "name='filename.txt'" - Command to list the file
fields id,name,driveid filepath - Specify output
corpora alldrives - Make the search include Shared Drives; omit to only look at My Drives
Ross