vbs获得当前路径所有文件夹的名称

2024-12-16 13:21:54
推荐回答(2个)
回答1:

呵呵,原来是团友啊我写了一个!!Set ws=WScript.CreateObject("wscript.shell")
w=ws.CurrentDirectory
Set fso=WScript.CreateObject("scripting.filesystemobject")
Set fs=fso.GetFolder(w)
Set f=fs.SubFolders
For Each uu In f
t=t & uu.Path & vbcrlf
Next
MsgBox t

回答2:

Set fso = CreateObject("scripting.filesystemobject")

With fso.GetFolder(".")

For Each SB In .SubFolders

WScript.Echo sb.name

Next

End With