源码如下:
function listfilespath(filepath) t1=timer() debug.writeline "****现在开始执行计数,用时:"+cstr(t1) set fso=createobject("scripting.filesystemobject") set myfolder=fso.getfolder(filepath) if fso.folderexists(filepath) then set subcol=myfolder.subfolders set filescol=myfolder.files for each file in filescol debug.writeline filepath+""+file.name next if subcol.count>0 then for each folder in subcol 'debug.writeline filepath+""+folder.name listfilespath(filepath+""+folder.name) next end if else debug.writeline "没有该文件系统" end if set filescol=nothing set subcol=nothing set fso=nothing t2=timer() debug.writeline "****现在完成计数,用时:"+cstr(t2) debug.writeline "整个操作过程用时:"&cstr(t2-t1)&" 秒" end function
之前小编更新过类似的文章,大家可以参考一下