Search directories and list out entries...

Hi...

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
...etc..

Any help would be appreciated..

Thanks
rakkadAsked:
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.

telczj9Commented:

Rakkad,

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

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

Cheers!
0
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
...etc..


0
telczj9Commented:
Rakkad,

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:

<file_path>\<file_name>.ini:AdapterUDPPortNumber=4343
<file_path>\<file_name>.ini:AdapterUDPPortNumber=1234
<file_path>\<file_name>.ini:AdapterUDPPortNumber=4321

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 " - "

Cheers!
0

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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

rakkadAuthor Commented:
This has worked thanks
0
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
0
telczj9Commented:
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.

telczj9
0
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
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.