A possible batch file for this task would be:
@echo off
cd /D C:\
del "%USERPROFILE%\SearchResults.txt" 2>nul
%SystemRoot%\system32\findstr.exe /I /S /C:"string" *.htm *.html *.txt *.xml >"%USERPROFILE%\SearchResults.tmp"
ren "%USERPROFILE%\SearchResults.tmp" "SearchResults.txt"
First the current directory is changed to root of drive C:.
Next a perhaps existing search results file from a previous run on desktop of current user is deleted.
Then findstr is executed to search for the string case-insensitive in the files specified with wildcards on the command line. More file extensions can be appended. There is no file extension for "all text files".
findstr prints for each found occurrence the name of the file and the found line to stdout which is redirected into a text file with file extension tmp to desktop of current user. It is not advisable to give the results file a file extension being specified also on command line of findstr.
Finally the created results file is renamed to change file extension from tmp to txt.
But searching for a string in thousands of files with writing all found lines with name of file into a results file needs time. On second run the tasks finishes already faster because Windows will have many files already loaded in cache and does not access a second time the storage media for those files not changed in the meantime.
BTW: A case-sensitive search done with removing /I is much faster than a case-insensitive search.