VBS递归遍历文件夹
'WalkFolders.vbs 't0nsha<liaodunxia#gmail.com> '2010/3/20 '得到脚本文件所在的当前目录 Function GetCurrentFolderFullPath Set fso = CreateObject("Scripting.FileSystemObject") GetCurrentFolderFullPath = fso.GetParentFolderName(WScript.ScriptFullName) End Function 'vbs递归遍历当前目录下的所有文件夹和子文件夹 Function GetSubFolders(currentFolderFullPath) Set fso = CreateObject("Scripting.FileSystemObject") Set currentFolder = fso.GetFolder(currentFolderFullPath) Set subFolderSet = currentFolder.SubFolders For Each subFolder in subFolderSet 'MsgBox "subFolder.Path=" & subFolder.Path GetSubFolders = subFolder.Path & ";" & GetSubFolders(subFolder.Path) & GetSubFolders Next End Function MsgBox GetSubFolders(GetCurrentFolderFullPath)
转载于:https://www.cnblogs.com/zlja/archive/2010/03/20/2449151.html
总结
以上是生活随笔为你收集整理的VBS递归遍历文件夹的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 从csv文件批量创建AD用户,带源码。
- 下一篇: sqlserver中实现split分割字