How to get MAC Address by Pinging IP or Computer Name

S

Saine

Hey Friends,

Inside of a network (LAN) is it possible to get the MAC
address, by pinging any computer (IP or Name). I am using
the windows 2000.

Thanks and regards,

Saine
 
P

Peter Forster [MVP]

Hello Saine!

Inside of a network (LAN) is it possible to get the MAC
address, by pinging any computer (IP or Name). I am using
the windows 2000.

If you ping the computer you can find the MAC address in the arp cache.

Open a cmd and put in: arp -a

With the free GFI Security Scanner you can also scan the IP-Adress.
http://www.gfi.com/lannetscan/
 
S

Saine

Yes Friend,

What ever information i got from there i mad a batch file
(IPMAC.BAT) and whenever i run that (IPMAC.BAT)i got this
this text "Syntax call IPMAC IP MAC" but it does not give
me any other info of any other system's IP, MAC or
Hostname.

The info whatever i did put in that batch file you can
see written downside:

@echo off
if {%2}=={} goto noP2
if {%1}=={} goto noP1
setlocal
for /f "Tokens=2 Delims=[]" %%i in ('ping -n 1 "%
computername%"') do set IP=%%i
if not defined IP set IP=n.o.n.e&set MAC=No-IP&goto :end
for /f "Skip=10 Tokens=1* Delims=:" %%i in
('ipconfig /all') do set p1=#%%i&set p2=#%%j&call :parse
if not defined MAC set MAC=No-MAC
:end
endlocal&set %1=%IP%&set %2=%MAC%
goto :EOF
:noP2
if {%1}=={} goto noP1
set %1=n.o.p.2
:noP1
@echo Syntax call IPMAC IP MAC
goto :EOF
:parse
if "%p1%" EQU "#" goto :EOF
set wrk=%p1:physical Address=%
if "%p1%" NEQ "%wrk%" set PA=%p2:~2%&goto :EOF
set wrk=%p1:IP Address=%
if "%p1%" EQU "%wrk%" goto :EOF
set WIP=%p2:~2%
if /i "%IP%" NEQ "%WIP%" goto :EOF
set MAC=%PA%
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top