How do I write a Windows batch script to copy the newest file from a directory?
The accepted answer gives an example of using the newest file in a command and then exiting. If you need to do this in a bat file with other complex operations you can use the following to store the file name of the newest file in a variable: FOR /F “delims=” %%I IN (‘DIR “*.*” … Read more