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

Multiple folder search

Status
Not open for further replies.

SMWis

Programmer
Jan 9, 2008
1
US
Greetings all, new to this, and to vbscripting, so hopefully you can forgive my dumb questions.

I've been trying to put together a vbscript that will search for multiple folders in a directory, but I need to do it from a text file. The text file would contain the names of the folders I want to look for. For example:

010108
010208
010308

I want the script to open the text file, read the first line, string the directory back into the code, and search for the folder, which would have a directory path of C:\Program Files\Me\

So the script would be searching for C:\Program Files\Me\010108

Once it finds it, it then goes back to the code, looks at the second line, and searches for the next folder, and so on.

If it doesn't find a folder, it creates a text file that tells me which ones it didn't find.

I can find folders, open text, write to text, but can't get it to open the text, read the first line, incorporate it back into the code, and look for the folder. Hopefully I have explained myself ok here. Appreciate any help with this!

Steve
 
Search this forum or the web for .ReadLine(). Wherever you find that you find an example of reading the lines from a text file. The same would be true if you search for .ReadAll() but not always.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top