呵呵,原来是团友啊我写了一个!!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
把下面代码复制到VBS文件,运行后获取当前文件夹路径下的所有文件夹名字(不带路径)
文件夹名字生成在Comp.txt中
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.Name & vbcrlf
Next
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile("comp.txt", True)
MyFile.WriteLine(t)
MyFile.Close
MsgBox t