5
如何修改此VBScript以仅返回最新文件的名称和上次修改日期?目前它返回在过去24小时内修改的任何内容。我只想查找最新的文件。我从StackOverflow中借用了这个,而不是VBScript向导。使用VBScript在单个文件夹中查找最新文件日期
option explicit
dim fileSystem, folder, file
dim path
path = "C:\test"
Set fileSystem = CreateObject("Scripting.FileSystemObject")
Set folder = fileSystem.GetFolder(path)
for each file in folder.Files
if file.DateLastModified > dateadd("h", -24, Now) then
'whatever you want to do to process'
WScript.Echo file.Name & " last modified at " & file.DateLastModified
end if
next