Quote Originally Posted by WAW View Post
Thanks for the code guys, appreciate it.

Unfortunately, I am unable to get either to work.

snb - opens CMD but hangs "File Not Found" on the first Loop.
Please try this way:


Sub Folder_and_file()
Dim fs, f, f1, fc, s, folderspec, temp, myname As String
Set fs = CreateObject("Scripting.FileSystemObject")
folderspec = "C:\aftere\Adobe CS4\deployment"
On Error GoTo Handler: Set f = fs.GetFolder(folderspec)
On Error GoTo Handler1: Set fc = f.subfolders
For Each f1 In fc
   If f1.datecreated > temp Then temp = f1.datecreated: myname = f1.Path
Next
Set f = fs.GetFolder(myname): Set fc = f.Files
For Each f1 In fc
    If f1.Size > temp Then temp = f1.Size: myname = f1.Name
Next: Debug.Print temp & vbCrLf; myname: Set f = Nothing: Set fc = Nothing
Exit Sub
Handler:
MsgBox "Folder does not exist", vbCritical
Handler1:
MsgBox "This folder does not have subfolders inside", vbCritical
End Sub