Some test artifacts are generated with random names or appended with time-stamps.

This makes it difficult to attach the right file to the test run.

Below is an example to find the latest screenshot file.

REM Upload test screenshot.  
Set fso = CreateObject("Scripting.FileSystemObject")  
Set folder = fso.GetFolder(screenshotPath)  
Set recentFile = Nothing

REM Search for the latest image file in the folder.  
For Each file in folder.Files  
   If UCase(fso.GetExtensionName(file.name)) = "PNG" Then
      If (recentFile is Nothing) Then
        Set recentFile = file
      ElseIf (file.DateLastModified > recentFile.DateLastModified) Then
        Set recentFile = file
      End If
   End If
Next

REM