title: Windows batch: forfiles output filenames with weird characters
body: <p>I'm trying to run a script on a 2008 Server which invokes a batch file with the following parameters:</p>
  
  <pre><code>forfiles -p %log_dir% -s -m *.* -d -3 /C "cmd /c echo @path" &gt; %cfg_dir%\Filelist.txt"
  </code></pre>
  
  <p>My issue is that the output that is being written to a file, whenever the filename has non-ASCII characters (such as <code>é</code>, <code>ç</code>, <code>ã</code>), it is written with the wrong characters, example:</p>
  
  <p>The file found is </p>
  
  <pre><code>S:\FOLDER\SUBFOLDER\0_Certi**dão** Predial.pdf
  </code></pre>
  
  <p>and it's written to the output file as </p>
  
  <pre><code>"S:\FOLDER\SUBFOLDER\0_Certi**d¦o** Predial.pdf"
  </code></pre>
  
  <p>I've already changed the charset to 850 (it was 470) but the output still comes out the same.</p>