How to copy the two most recent log files to another folder?
问题 I am trying to copy the two most recent error logs from a source location to another folder which is easier to access. I found the code below on Magoo's post here and the instructions were to replace echo %%i with the appropriate copy command. I am having a hard time with that for some reason. @ECHO OFF SETLOCAL SET transfer=xx FOR /f "delims=" %%i IN ('dir/b/a-d/o-d *.*') DO IF DEFINED transfer CALL SET transfer=%%transfer:~1%%&ECHO %%i My final line with the echo %%i replaced looks like