Glenn's right, the substring indexes are at fault.

You will recall that I said the original script was mixing dates from the file timestamp and the file name. The timestamp code will always work OK, but the code which extracts the month and year from the file will only work so long as the file is exactly the right pattern. Having not seen the filenames at the start I calculated them based on the comments in the original script, and one of us was off \:\)

The month and year are extracted from the filename in two places, and neither of these match your sample filenames at the moment.

Are the filenames *always* in the form of the sample that you provided, i.e. 2 digit year in positions 3-4, and month code in position 5?

If that is the case you need to change the following two lines:

 Code:
$sFileYear="20"+SubStr($sFile,4,2)

...change substring start position 4 to 3...
 Code:
$sFileYear="20"+SubStr($sFile,3,2)


And
 Code:
$iMonthIndex=InStr($sMonthLetters,SubStr($sFile,6,1)

...change substring start position 6 to 5...
 Code:
$iMonthIndex=InStr($sMonthLetters,SubStr($sFile,5,1)


BTW, I used "00-All" rather than "All" for the directory name for invalid month codes as the original script stated a requirement for a natural directory sort. If this is a problem then we can fix it up quite simply.