Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import os
  2. #import wmi
  3. import cpuinfo
  4. from psutil import virtual_memory
  5. import subprocess
  6.  
  7. #assetTag = 'N/A'
  8. windowsKey = "N/A"
  9. cpuBrand = "N/A"
  10. memTotal = "0"
  11.  
  12. #def get_service_tag():
  13. #computer = wmi.WMI()
  14. #bios_info = computer.Win32_SystemEnclosure()
  15. #for info in bios_info:
  16. #assetTag = info.SerialNumber
  17.  
  18. def get_windows_license():
  19. windowsKey = subprocess.check_output(['wmic', 'path', 'softwarelicensingservice','get','OA3xOriginalProductKey'])
  20.  
  21. def get_cpu_info():
  22. cpu = cpuinfo.get_cpu_info()
  23. cpuBrand = cpu["brand"]
  24.  
  25. def get_mem_total():
  26. mem = virtual_memory()
  27. memTotal = mem.total
  28.  
  29. #get_service_tag()
  30. get_windows_license()
  31. get_cpu_info()
  32. get_mem_total()
  33.  
  34. #print(assetTag)
  35. print(windowsKey)
  36. print(cpuBrand)
  37. print(memTotal)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement