本帖最后由 328612167 于 2018-12-5 09:59 编辑
vbs怎么按照时间顺序排列输出遍历的文件夹- Set fs = CreateObject("Scripting.FileSystemObject")
- Set f = fs.GetFolder("c:\")
- Set fc = f.SubFolders
-
- nn = 1
- wjj = ""
- For Each f1 In fc
- wjj = wjj &vbcrlf& nn &" "&f1.DateCreated&" "&f1.Name
- nn=nn+1
- Next
-
- MsgBox wjj
- WScript.Quit
复制代码 在网上搜到这个贴但是报错
http://www.sdky.org/news/2018-04-06/108467.html- Set objLogParser=CreateObject("MSUtil.LogQuery")
- Set objInputFormat=CreateObject("MSUtil.LogQuery.FileSystemInputFormat")
- objInputFormat.Recurse=0
-
- Set objOutputFormat=CreateObject("MSUtil.LogQuery.NativeOutputFormat")
- objOutputFormat.rtp=-1
-
- strQuery="SELECT Name,CreationTime FROM 'C:\*.*'"&_
- "WHERE NOT Attributes LIKE '%D%' ORDER BY CreationTime"
- objLogParser.ExecuteBatch strQuery,objInputFormat,objOutputFormat
复制代码
|