Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a collection from a network share

Status
Not open for further replies.

DFinnegan

MIS
May 22, 2002
8
US
Hello,

I am trying to create a collection from a network share so I can search each folder in the network share for certain files. I have the searching part down if I specify a specific folder name but there are hundreds of folders. I cannot figure out how to use VBScript to create a collection of folders from something like \\svrname\myshare$. How can I create a collection from a share name like that and then use something like oFSO.GetFolder("objNetShareFolder") to recursively search for what I need?
Maybe a VBSCript collection is not the answer. Anyone know a way with WMI scripting?

Thank you,
Dan
 
I was able to solve this via another post in another forum.
The key for me was this snipet of code:
For Each fld In .RootFolder.SubFolders
If Not fld Is Nothing Then

Using the drive object, and specifying the drive letter I wanted, I was able to use this code to search my network share for the files I needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top