vbs下通过日期查找文件夹的代码
程序员文章站
2022-07-04 20:46:47
on error resume next dtmtargetdate = "20020301000000.000000-4...
on error resume next
dtmtargetdate = "20020301000000.000000-420"
strcomputer = "."
set objwmiservice = getobject _
("winmgmts:" & "!\\" & strcomputer & "\root\cimv2")
set colfolders = objwmiservice.execquery _
("select * from win32_directory where creationdate > '" & _
dtmtargetdate & "'")
for each objfolder in colfolders
wscript.echo objfolder.name
next
dtmtargetdate = "20020301000000.000000-420"
strcomputer = "."
set objwmiservice = getobject _
("winmgmts:" & "!\\" & strcomputer & "\root\cimv2")
set colfolders = objwmiservice.execquery _
("select * from win32_directory where creationdate > '" & _
dtmtargetdate & "'")
for each objfolder in colfolders
wscript.echo objfolder.name
next