title: Suppress "File Not Found" in Batch File
body: <p>I was trying to run below bat file which gives me number of files present in a folder, i was getting the count as per the files but if there is no files i am getting &quot;File Not Found&quot;</p>
  <p>Count is 0 and which is okay, but i want to suppress &quot;File Not Found&quot;</p>
  <p>Script:</p>
  <pre><code>@echo off
  
  setlocal enabledelayedexpansion
  
  @echo off
  
  set c2=0
  
  echo Folder,NoOfFiles
  
  for  /f &quot;tokens=*&quot; %%x in ('dir /s /a /b &quot;D:\Flow\Flow1\Flow2\Flow3\NGR*.txt&quot;') do set /a c2+=1
  
  echo.NGR,!c2!
  </code></pre>
  <p>Result:</p>
  <blockquote>
  <p>Folder,NoOfFiles</p>
  <p>File Not Found</p>
  <p>NGR,0</p>
  <p>Press any key to continue . . .</p>
  </blockquote>
  <p>I was trying to use 2&gt;nul but that was also not working</p>
  <p>Can someone please help me to get the solution, what can be done here?</p>