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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Basic Folder Search

Status
Not open for further replies.

Ca1icoJack

IS-IT--Management
Nov 27, 2008
36
GB
I have files scattered throughout my harddrive and network. The path to them is obviously different, but the final folder and contents are labelled identically. How could I search my entire network for such folders?

I tried using a wildcard to specify all locations:

"\*\ & MyFolder & "\Inspect\"

I want to be able to chose the variable MyFolder and copy certain files from "Inspect" into another centralised folder.

How would I do this?
 
Could be wrong...but I believe you are going to have to make a list of the root drives (and network drives) and then enumerate through that list with your search criteria. However, you should be able to build that list dynamically in code (as some machines may be turned off or unavailable right at that moment).

Good Luck
 
How exactly are you trying to do this? Using Application.FileSearch? Some other scripting method?

Are you even doing this by code? If so, you may be better off posting to a coding forum.

vb5prgrmr is right though. You are most likely going to have to enumerate through the folders from each root.

faq219-2884

Gerry
My paintings and sculpture
 
Hi,

Please post VBA questions in forum707.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
We do not even know if it is VBA.

Heck, we do not even know if this is a coding question, although admitedly it seems like one.

faq219-2884

Gerry
My paintings and sculpture
 
I dunno, the title seemed like a tiny hint to me. ;-)

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Ooops...yes, it is a coding question..duh..."Visual Basic" may be a clue.

Since the OP is not responding, I sugest we fogedaboutit.

faq219-2884

Gerry
My paintings and sculpture
 
Hey, I grew up in the Phillie area, and I know all about "fugedaboudit."

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Ooops. My spelling mistake. It is decidely a "u" and a "d", as in fugedaboudit.





I put it into my AutoCorrect in Word. Thanks Skip.

faq219-2884

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top