We help IT Professionals succeed at work.
Get Started

Need VBScript to read a line that contains a program name and then look for it in a folder

Last Modified: 2012-05-12
Hello everyone.
Can I ask for some help ?
(I'd really REALLY be grateful for it.)

I have a file, C:\RayFile.txt".
This file contains a bunch of lines.
Interspersed within all the lines are a number of lines that contain the names of objects.
Here's an example of what one of those lines look like:
<file name="BLAnnWb4.ocx">

Now,  there is a folder, named "C:\RaysFolder", that is supposed to contain the actual object referenced by each <file name="????????.???"> line, inside of C:\RaysFiles.txt.

But sometimes, C:\RaysFolder is missing a file or two that have corresponding  <file name="????????.???"> lines (inside of C:\RaysFiles.txt).

I need a VBScript to read though the Ray.txt file for each occurrence of "<file name=".
Then using the value between the beginning and ending double quotes (IE:  BLAnnWb4.ocx), look to see if there is a file of the same name, in C:\RaysFolder.

If the file is missing from C:\RaysFolder, a dialog or something, indicating the same,  would be great.

I really do appreciate the help with this as I am not a VBScript expert and having such a script, would save me lots of time and help my eyesight as well.
(Cuz I do this process manually now.)

Thanks in advance for any and all efforts on my behalf.

Ray in Wisconsin
Watch Question
Test your restores, not your backups...
Expert of the Year 2019
Distinguished Expert 2020
This problem has been solved!
Unlock 1 Answer and 11 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE