Link to home
Start Free TrialLog in
Avatar of ForLoop5
ForLoop5Flag for United States of America

asked on

Bat file to echo list of computers

I am trying to make a bat file that will list all the computers turned on in my building.   They are all part of the same domain.  I can create the list but I am also trying to format the list so that only the computer names show up, one name on each line with no spaces.  I used the command "net view" to list all the computers turned on, on the domain. Then I use the find command to list only the computers I am looking for.  Then I need to remove all the "\\"  and all the white spaces.  Can you help me with this?  Im using windows 7 computers.  
net view > x.txt
find /I "CRL" x.txt > z.txt

Open in new window

Avatar of telczj9
telczj9

There is a command line utilty called bsed.exe that works very much like sed in unix.  It will allow you to search and replace.

Cheers!
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ForLoop5

ASKER

That worked great.  Thank you!
Very welcome, glad that helped.

~bp