如何修改此VBScript以仅返回最新文件的名称和上次修改日期?目前它返回过去24小时内修改的任何内容 . 我想只查找最新的文件 . 我是从StackOverflow借来的,还不是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
1 回答
你非常接近它: