II'm not sure that I correctly understand your question, but I think that what you are asing is: The file C\Users\Documents\Flag.txt contains some text. You wish to search some folder and it's subfolders for files that contain this text.
You can do that with findstr.
findstr /g:C\Users\Documents\Flag.txt /s C:\TheTopFolderThatYouWantToSearch\*
If you would only want to search .txt files, you would do it like this.
findstr /g:C\Users\Documents\Flag.txt /s C:\TheTopFolderThatYouWantToSearch\*.txt
https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/findstr