Posted By

brm on 06/16/15


Tagged

batch sysadmin


Versions (?)

Copy newest file


 / Published in: DOS Batch
 

batch script to copy newest file from directory to another directory

  1. @echo off
  2.  
  3. FOR /F %%I IN ('DIR "\\src-dir\file*.ext" /B /O:-D') DO XCOPY "\\src-dir\%%I" "\\dst-dir\filename.ext" /D /V /Y
  4.  
  5. cls

Report this snippet  

You need to login to post a comment.