title: Is it possible to search string in file and display filename as variable in batch
body: <p>Im trying to search for files as a batch kinda like when your in a folder and you can type what your looking for and it will display names of files with that sting within that file but I want to use it as a variable in a batch</p>
  
  <p>Kinda like</p>
  
  <pre><code> @echo off
  :Start  
  Title Details Search
  
  set /P "result1=Number1" 
  
  for /f %%i in ('findstr /i "%result%" "C:\Users\%USERNAME%\Desktop\Folder\*"') do @echo %result1% found in %%~nxi
  
  set /P "result2=Number2: " 
  
  for /f %%i in ('findstr /i "%result2%" "C:\Users\%USERNAME%\Desktop\Folder\*"') do @echo %result2% found in %%~nxi
  
  Pause
  </code></pre>
  
  <p>It wont allow me to do more than one, where the one below works great with a special thanks to Gerhard Barnard but its only one</p>
  
  <pre><code>@echo off
  :Start  
  Title Details Search
  
  set /P "result=what would you want to search today?: " 
  
  for /f %%i in ('findstr /i "%result%" "C:\Users\%USERNAME%\Desktop\Folder\*"') do @echo %result% found in %%~nxi
  Pause
  </code></pre>
  
  <p>The outcome im trying to get is something like</p>
  
  <p>Bob 543-434-4324
  Tom 234-253-2463</p>
  
  <p>Where the name is the filename and the number is what I typed it. So if I type it in the number it will display next to the filename it found
  Note- These are not real numbers I just typed random numbers</p>