title: How to have batch file code only copy the most recent .bak file from a directory
body: <p>I recently had very kind assistance on how to make the below code copy the most recent file from a file on my C:\ called 'C:! BATCH' </p>
  
  <p>It's transpired that I now need to have the batch file only look for .bak files in this dorectory, and while I'm positive this is a relatively simple tweak, I've so far had no luck on finding how this is done.</p>
  
  <p>Any advice on this would be very much appreciated, many thanks!</p>
  
  <pre><code>@echo off
  pushd C:\! BATCH
  setLocal EnableDelayedExpansion
  for /f "tokens=* delims= " %%G in ('dir/b/od') do (set newest=%%G)
  copy "!newest!" C:\DROP\
  PAUSE
  </code></pre>