Home / Microsoft / Microsoft DOS / all mac in LAN
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: all mac in LAN  (Read 225 times)
zodehala
Topic Starter
Rookie



Posts: 48




« on: February 03, 2012, 09:19:18 AM »

we have 2 workgroup in win network (workgroup and callcenter)

first of all i am listing pc using net view /domain:workgroup and  net view /domain:callcenter

and ping it to find ip and MAC

callcenter pc name is like

\\Agent-1
\\Agent-2
..
..
\\Agent-100

i can find a pc MAC  usign this command nbtstat -a Agent-1

1- how can i find all pc mac usign just one command ?
2- i can print it into text file like command > c:\conf.txt. how can i do it for all pc at one time
IP logged
Raven19528
Hopeful



Thanked: 29
Posts: 284

Computer: Specs
Experience: Experienced
OS: Windows 7



« Reply #1 on: February 03, 2012, 10:36:43 AM »

Try this short piece of code:
Code: [Select]
@echo off
setlocal enabledelayedexpansion

for /f "delims=" %%A in ('net view /domain:workgroup') do (
  set comp=%%A
  set comp=!comp:~2!
  nbtstat -a !comp! >>MAC.txt
)

If you are wanting to have a specific output that is maybe only one or two lines per entry, it will require some additional work, so let us know if that is what you are wanting.
« Last Edit: February 03, 2012, 10:47:41 AM by Raven19528 » IP logged

"All things that are
Are with more spirit chased than enjoy'd" -Shakespeare
zodehala
Topic Starter
Rookie



Posts: 48




« Reply #2 on: February 04, 2012, 02:47:03 AM »

first of all

fetching mac all pc in workgroup in one go
IP logged
Raven19528
Hopeful



Thanked: 29
Posts: 284

Computer: Specs
Experience: Experienced
OS: Windows 7



« Reply #3 on: February 06, 2012, 02:29:43 PM »

first of all

fetching mac all pc in workgroup in one go
Ummm... What?
IP logged

"All things that are
Are with more spirit chased than enjoy'd" -Shakespeare
Pages: [1] - (Top) Print 
Home / Microsoft / Microsoft DOS / all mac in LAN « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.112 seconds with 20 queries.