Home > Article > Web Front-end > VBS code to get the names of all folders in the current directory
VBS gets the names of all folders in the current directory, excluding subfolders. I want to operate each folder, so it is best to use loop output.
When testing, make sure there is a folder in the current directory, otherwise the output will be empty.
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
For more VBS code related articles to obtain the names of all folders in the current directory, please pay attention to the PHP Chinese website!