<p>I need to copy the newest file in a directory to a new location. So far I've found resources on the <a href="http://www.ss64.com/nt/forfiles.html" rel="noreferrer">forfiles</a> command, a <a href="https://stackoverflow.com/q/51837">date-related question</a> here, and another <a href="https://stackoverflow.com/q/50902">related question</a>. I'm just having a bit of trouble putting the pieces together! How do I copy the newest file in that directory to a new place?</p>

I know you asked for Windows but thought I'd add this anyway,in Unix/Linux you could do:
```
```
cp `ls -t1 | head -1` /somedir/
```
```
Which will list all files in the current directory sorted by modification time and then cp the most recent to /somedir/