Computer Hope
Microsoft => Microsoft DOS => Topic started by: zodehala 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
-
Try this short piece of code:
@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.
-
first of all
fetching mac all pc in workgroup in one go
-
first of all
fetching mac all pc in workgroup in one go
Ummm... What?