Last active
December 21, 2015 09:29
-
-
Save software-mariodiana/6285873 to your computer and use it in GitHub Desktop.
Iterate through files in a folder and get the modification time for each INI file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set theFolder = fso.GetFolder("C:\Windows") | |
Wscript.Echo "Directory:" & vbNewLine & theFolder.Path | |
Set theFiles = theFolder.Files | |
For Each aFile in theFiles | |
' Note: You have to use the File System Object! | |
If UCase(fso.GetExtensionName(aFile.Name)) = "INI" Then | |
Wscript.Echo "File:" & vbNewLine & aFile.Name | |
Wscript.Echo "Modified:" & vbNewLine & aFile.DateLastModified | |
Wscript.Echo "Days old: " & DateDiff("d", aFile.DateLastModified, Date) | |
End If | |
Next |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment