How to get Local IP and MAC address

Go down

How to get Local IP and MAC address

Post by Admin on Sat Mar 11, 2017 8:06 pm

Hi
I want to share with you what i have tested on my PC with Windows 7 32 bits (French Machine) and of course i wonder if this same script will work or not on other machines (English, German and so on .....)
Here is the script :
Get_IP_MAC.bat

PHP Code:
Code:
@echo off
Title Get IP and MAC Address
@for /f "delims=[] tokens=2" %%a in ('ping -4 -n 1 %ComputerName% ^| findstr [') do (
    set "MY_IP=%%a"
)

@For /f %%a in ('getmac /NH /FO Table') do  (
    @For /f %%b in ('echo %%a') do (
        If /I NOT "%%b"=="N/A" (
            Set "MY_MAC=%%b"
        )
    )
)
echo Network IP : %MY_IP%
echo MAC Address : %MY_MAC%
pause>nul 
So, i'm waiting for your testing and your feed back
Thank you

Admin
Admin

Posts : 23
Join date : 2017-03-11

View user profile http://toolssupplier.board-directory.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum