Function GetCurrentFolderFullPath
Set fso = CreateObject("Scripting.FileSystemObject")
GetCurrentFolderFullPath = fso.GetParentFolderName(WScript.ScriptFullName)
End Function
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 & vbcrlf & GetSubFolders & GetSubFolders(subFolder.Path)
Next
End Function
MsgBox GetSubFolders(GetCurrentFolderFullPath)
求大牛一行行给小弟解释vbs遍历目录的代码
答案:1 悬赏:30
解决时间 2021-01-30 09:07
- 提问者网友:芷芹
- 2021-01-29 21:42
最佳答案
- 二级知识专家网友:厌今念往
- 2021-01-29 23:06
第一行就有错误
Function GetCurrentFolderFullPath
应该写成
Function GetCurrentFolderFullPath()
基本上错误很多,代码很多多余。。是一个新手编的程序。不想解释
Function GetCurrentFolderFullPath
应该写成
Function GetCurrentFolderFullPath()
基本上错误很多,代码很多多余。。是一个新手编的程序。不想解释
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯