Option explicit <br/> msgbox "f files and folders" <br/> throughfiles <br/> throughfolder <br/> sub throughfiles <br/> dim FSO, allfiles, eachfile <br/> set FSO = Createobject ("scripting. fileSystemObject ") <br/> set allfiles = FSO. getfolder ("F:/") <br/> for each eachfile in allfiles. files <br/> msgbox "file:" & "& eachfile. name & "<br/> next <br/> end sub <br/> sub throughfolder <br/> dim FSO, allfolders, eachfolder <br/> set FSO = Createobject ("scripting. fileSystemObject ") <br/> set allfolders = FSO. getfolder ("F:/") <br/> for each eachfolder in allfolders. subfolders <br/> msgbox "folder:" & "& eachfolder. name & "<br/> next <br/> end sub <br/>
This is one of the results of my vbs research over the past two weeks. In fact, I just used the attributes and methods described in the book briefly. I hope they will help those who learn vbs.