Quantcast
Channel: Active questions tagged windows - Super User
Viewing all articles
Browse latest Browse all 9656

Xcopy: Copy last modified file from folder

$
0
0

I need to copy the last modified file of a particular extension from a folder. For example a folder contains:

  • File1.cas
  • File1.txt
  • File2.cas
  • File2.txt
  • File3.cas
  • File3.pptx
  • ...
  • File100.cas
  • File100.pptx
  • File100.doc

The date and time modified is the latest for file56.casI would like to copy only file56.cas, while copying files of other extensions as normal, and ignoring files with no extensions (the part already configured).

To ignore files with no extensions, I am using the solution found here:Exclude files with no extension - XCOPY or ROBOCOPYThe specific code is:robocopy source destination /xf *.?


Viewing all articles
Browse latest Browse all 9656

Trending Articles