Search directories and list out entries...


I need a .vbs or .bat script that will search all directories in \\cslwinprn01\tsprofiles$\... and particulary look for a WINDOWS directory and find an entry in the BCS.INI called AdapterUDPPortNumber='xxxx'

where 'xxxx' is a random number....

I would like a list that will display the name of the users directory and the number used in the AdapterUDPPortNumber e.g...

tek-rjk.NBS - AdapterUDPPortNumber=4343
thp-sfm.NBS - AdapterUDPPortNumber=3445

Any help would be appreciated..

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.



Pit this in a batch file and it will give you the file path and the value you are looking for:

For /f "tokens=*" %%I in ('Dir /s /b \\clswinprn01\tsprofile$\BCS.INI') do (
FINDSTR "AdapterUDPPortNumber" %%I

rakkadAuthor Commented:
Will this produce a list e.g. into a txt format, e.g.....

tek-rjk.NBS - AdapterUDPPortNumber=4343
thp-sfm.NBS - AdapterUDPPortNumber=3445


oh! okay.  If you just use the like below on the command line or batch file:

FINDSTR /S "AdapterUDPPortNumber" \\clswinprn01\tsprofile$\BCS.INI 

Open in new window

you will get an output of:


Let me know if the <file_path> depth is predictable and that can be removed too if you want it.  ":" could also be replaced for " - "


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

rakkadAuthor Commented:
This has worked thanks
rakkadAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for rakkad's comment #37344497

for the following reason:

This solution worked for me
the solution provided worked for Rakkad.  Moderator, I don't understand why Rakkad would not award points.  Perhaps Rakkad does not know what the process is for awarding points.

Thank you.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.