Option Explicit
Dim oFSO: Set oFSO = CreateObject("Scripting.FileSystemObject")
GetFileInfo ("C:\")
Set oFSO = Nothing
Sub GetFileInfo (ByVal strPath)
Dim oFolder, oSubFolders, oSubFolder, oFiles, oFile
Set oFolder = oFSO.GetFolder (strPath)
Set oFiles = oFolder.Files
For Each ofile In oFiles
WScript.Echo "FileName: " & oFile.Name
WScript.Echo "Path: " & oFile.Path
WScript.Echo "Attributes: " & oFile.Attributes
WScript.Echo "Date Created: " & oFile.DateCreated
WScript.Echo "Date Last Accessed: " & oFile.DateLastAccessed
WScript.Echo "Date Last Modified: " & oFile.DateLastModified
WScript.Echo "FileSize: " & oFile.Size
WScript.Echo "FileType: " & oFile.Type & vbcrlf
Next
Set oSubFolders = oFolder.SubFolders
For Each oSubFolder In oSubFolders
GetFileInfo (oSubFolder.Path)
Next
Set oSubFolder = Nothing
Set oSubFolders = Nothing
Set oFile = Nothing
Set oFiles = Nothing
Set oFolder = Nothing
End Sub