Copy the latest file with a particular file extension

ITLsupport used Ask the Experts™
Great little piece of code by Paul Tomasi

just remember to use

copy "%latestfile%" c:\towherethefilesgo\
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Bill PrewTest your restores, not your backups...
Top Expert 2016

What is the question?

robocopy will copy the most up-to-date file from a source to a destination.

robocopy <source> <destination> /MIR /R:0

Make sure you practice this in a test environment before implementing it. You can find more info on switches here:

robocopy /?
Wowee!! I didn't expect that!

Thank you for mentioning me :)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial