Created
July 21, 2020 10:56
-
-
Save 0x2a94b5/3f05b99d7ba1a37bd20834274f19d34d to your computer and use it in GitHub Desktop.
Get mac address on windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# | |
# Get mac address on windows | |
# Package: Pyinstaller -y -F -c getMac.py | |
# | |
from subprocess import run, PIPE | |
try: | |
cmd = "C:\\Windows\\System32\\getmac.exe" | |
process = run(cmd, shell=True, check=True, stdout=PIPE, universal_newlines=True) | |
p = process.stdout.split()[4] | |
except: | |
p = "Command Error" | |
print(p) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment