1234567891011121314151617181920212223242526272829 | FunctionlistFilesPath(filepath) t1=Timer() Debug.WriteLine"****现在开始执行计数,用时:"+CStr(t1) Setfso=CreateObject("scripting.filesystemobject") Setmyfolder=fso.GetFolder(filepath) Iffso.FolderExists(filepath) then Setsubcol=myfolder.SubFolders Setfilescol=myfolder.Files ForEachfileInfilescol Debug.WriteLine filepath+"\"+file.name Next Ifsubcol.count>0Then ForEachfolderInsubcol 'Debug.WriteLine filepath+"\"+folder.Name listFilesPath(filepath+"\"+folder.Name) next Endif Else Debug.WriteLine"没有该文件系统" Endif Setfilescol=Nothing Setsubcol=nothing Setfso=Nothing t2=Timer()Debug.WriteLine"****现在完成计数,用时:"+CStr(t2)Debug.WriteLine"整个操作过程用时:"&CStr(t2-t1)&" 秒"Endfunction |
之前脚本之家小编更新过类似的文章,大家可以参考一下