# How to obtain the computer's hard drive serial number, BIOS ID, CPU number, MAC and so on use Mathematica?

I want to packed my program use RSA algorithm. Of course, \$MachineID can be used but I want to make it safer. Can Mathematica obtain the computer's hard drive serial number, BIOS ID, CPU number, MAC and so on? Or any other Machine Key? The command SystemInformation[] seems not include the other Machine Key.

• What OS are you on? Cross OS I'm quiet certain there is no way. – William Sep 15 '15 at 22:21
• All of my user's OS is Windows Thank you very much! – zzy Sep 16 '15 at 1:34
• The Mac address was a little tricky – William Sep 16 '15 at 1:44
• If already using wmic, then simply wmic nic get MacAddress should list all the MAC addresses. – ilian Sep 16 '15 at 14:35

## 2 Answers

According to Oleksandr R. wmic can only be run by Administrators. Here is how you get the Serial on Windows.

Import["!wmic bios get serialnumber", "Text"]


To get CPU information

Import["!wmic cpu get NumberOfCores, NumberOfLogicalProcessors/Format:List", "Text"]


To get the MAC Address run.

StringSplit[
StringReplace[
StringCases[Import["!ipconfig /all", "Text"],
"Physical Address. . . . . . . . . :" ~~ x___],
"Physical Address. . . . . . . . . : " -> ""], "\n"][[1, 1]]


And to get BIOS ID.

Import["!wmic bios get name,serialnumber,version", "Text"]

• I upvoted, but it should be mentioned that wmic can only be run by administrators. This is likely to be a problem in general, although I can't see any way around it. – Oleksandr R. Sep 16 '15 at 2:28
• Also, you only get the first MAC address from ipconfig, and it is not guaranteed that all media types have the same length of physical address. For instance on my computer I have 4, 6, and 8-byte physical addresses. – Oleksandr R. Sep 16 '15 at 2:35
• @OleksandrR. I admit I was concerned my mac address approach wasn't very practical. – William Sep 16 '15 at 2:36
• Instead of ipconfig /all you could also use getmac which is more compact. – Mark Messa Jan 24 '16 at 15:14

The only thing I could find very easily is the HWaddr of the network device that can be obtained by

SystemInformation["Network", "IPAddresses"]