Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Read the Device Manager Information

I just need to read all of the information that is listed in Device Manager with a python 2.7 script. Especially the information under 'IDE ATA/ATAPI controllers' subcategory. This is needed to detect whether the SATA drives are under AHCI or IDE mode...

Device Manager

like image 882
Erik343 Avatar asked Jun 04 '26 05:06

Erik343


1 Answers

One easy way (on Windows) is to use Windows Device Manager's API. There is a Python binding here. After installing the package, the code bellow will do fine:

from infi.devicemanager import DeviceManager
dm = DeviceManager()
dm.root.rescan()
devices = dm.all_devices
for device in devices:
    print(device)
like image 171
Parsa Avatar answered Jun 05 '26 20:06

Parsa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!