Traverse files and folders

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.