Find most recent file in a directory

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
montanan
Junior Coder
Posts: 49
Joined: Mon Jul 09, 2007 3:44 pm
Location: San Jose, CA

Find most recent file in a directory

Post by montanan » Wed Jun 22, 2011 12:42 am

I'm wondering if any of the forum members know of or have developed a function to find the most recently updated file in a folder.

I have some functions that output the entire DIR in date sort order and then I can get the last file, however, in this case the directory is very large and the DIR output approach is not efficient.

I have seen some indications that this may be doable in VB Script.

Any and all help is appreciated!

-Richard

montanan
Junior Coder
Posts: 49
Joined: Mon Jul 09, 2007 3:44 pm
Location: San Jose, CA

Post by montanan » Wed Jun 22, 2011 12:54 am

I found it in the forum. Seems to work great!

http://www.mjtnet.com/forum/viewtopic.php?p=8011

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts