Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Search directories and list out entries...

Posted on 2011-10-24
7
Medium Priority
?
290 Views
Last Modified: 2013-11-13
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
0
Comment
Question by:rakkad
  • 3
  • 3
6 Comments
 
LVL 3

Expert Comment

by:telczj9
ID: 37019213

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
 

Author Comment

by:rakkad
ID: 37024032
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
 
LVL 3

Accepted Solution

by:
telczj9 earned 2000 total points
ID: 37024632
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:rakkad
ID: 37344497
This has worked thanks
0
 

Author Comment

by:rakkad
ID: 37549117
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
 
LVL 3

Expert Comment

by:telczj9
ID: 37549118
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question