Hello guys!
I'm very new on programming but I'm enjoying it so far .
I need a tip to make a vbs file that returns a list of the subfolders and files of a main folder.
SO FAR I HAVE THIS (but it doesnt separates the fields in different columns)
Thank you so much for the help in advance!
I'm very new on programming but I'm enjoying it so far .
I need a tip to make a vbs file that returns a list of the subfolders and files of a main folder.
SO FAR I HAVE THIS (but it doesnt separates the fields in different columns)
Thank you so much for the help in advance!
Code:
[/COLOR]Dim fso
Dim ObjOutFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set ObjOutFile = fso.CreateTextFile("OutputFiles.csv")
ObjOutFile.WriteLine("File Path and Name ** " & "DateModified" & " ** Size in Kbs ** " & "Files on Folder")
GetFiles("C:\Intel")
ObjOutFile.Close
WScript.Echo("Completed")
Function GetFiles(FolderName)
Dim ObjFolder
Dim ObjSubFolders
Dim ObjSubFolder
Dim ObjFiles
Dim ObjFile
Set ObjFolder = fso.GetFolder(FolderName)
Set ObjFiles = ObjFolder.Files
For Each ObjFile In ObjFiles
ObjOutFile.WriteLine(ObjFile.Path & " ** " & ObjFile.DateLastModified & " ** " & ObjFile.Size)
Next
Set ObjSubFolders = ObjFolder.SubFolders
For Each ObjFolder In ObjSubFolders
ObjOutFile.WriteLine(ObjFolder.Path & " ** " & ObjFolder.DateLastModified & " ** " & ObjFolder.Size & " ** " & ObjFolder.Files.Count)
GetFiles(ObjFolder.Path)
Next
End Function
[COLOR=#333333]