Question
March 11, 2009 at 05:29 AM
plonka2000

vbscript to make copy of most recent file or 2nd most recent file

by plonka2000 . Updated 17 years, 6 months ago

Hi,
I have been trying to write a script that will determine the most recent file in a directory conforming to a naming convention, but I’m a stuck.

I have a program that outputs 3 files to a directory and I need to determine the most recent or ideally the 2nd most recent and copy those to a different directory.
All the files are already autonumbered, I just need to make a script that I can schedule that will do the determining and copying.

The file conventions I have are:
OUTPUT_34563f_258393
MARK0_34563f_258393
GHREWY_34563f_258393

Next output:
OUTPUT_34563f_258394
MARK0_34563f_258394
GHREWY_34563f_258394

etc…
The last number is the only one that changes, the 1st is content description and 2nd is machine serial.

Can anyone help me please?!

This discussion is locked

All Comments