VBS递归遍历文件夹
'WalkFolders.vbs 't0nsha<liaodunxia#gmail.com> '2010/3/20 '得到腳本文件所在的當(dāng)前目錄 Function GetCurrentFolderFullPath Set fso = CreateObject("Scripting.FileSystemObject") GetCurrentFolderFullPath = fso.GetParentFolderName(WScript.ScriptFullName) End Function 'vbs遞歸遍歷當(dāng)前目錄下的所有文件夾和子文件夾 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)
轉(zhuǎn)載于:https://www.cnblogs.com/zlja/archive/2010/03/20/2449151.html
總結(jié)
以上是生活随笔為你收集整理的VBS递归遍历文件夹的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 从csv文件批量创建AD用户,带源码。
- 下一篇: 用户态程序调用系统态程序-快速系统调用