Pages

Saturday, May 28, 2016

Get all MAC address of Windows System

###Script Starts here###
#Developed By Krunal Patel
#Script Works in Windows System Only
import os
import re
a = os.popen("getmac")
count = "1"
for value in a.readlines():
    m = re.search('[\w][\w]-[\w][\w]-[\w][\w]-[\w][\w]-[\w][\w]-[\w][\w]',value)
    if m:
        print ("MAC Address " + "%s" %count + " = " +"%s" %m.group(0))
        count = int(count) + 1
    else:
        continue
a.close()
###Script Ends Here###

This will give output as per highlighted in yellow marker in below screenshot.



No comments:

Post a Comment

Please give us suggestions.

Shell Script Code