- Joined
- Feb 25, 2023
- Messages
- 1
- Reaction score
- 0
I'm trying to list a system summary and a summary of the components like MutliMedia, Sound Device, Input, Networks, Port Storage with WMI and WIN32_classes so far I have come up with this solution:
Do I have to list them up al seperatly or can I iterate through them? It's hard to find the right WIN32_classes and Visual Studio Code isn't showing me the properties like Name or Caption with intellisense I wander if this is normal behaviour or Pycharm just works better and will show me the properties of the WIN32_classes (haven't tried it yet.).
import wmi
c = wmi.WMI()
# List Win32 classes:
# https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-provider
# How to get a list of system summary and components?
computer_systems = c.Win32_Computersystem()
componenten = c.WIN32_SystemDevices()
drivers = c.Win32_SystemDriver()
printJobs = c.Win32_PrintJob()
netwerkConnecties = c.Win32_NetworkAdapter()
runningTasks = c.Win32_Process()
services = c.Win32_Service()
startupPrograms = c.Win32_StartupCommand()
# print("System Summary: \n\n")
# for computer_system in computer_systems:
# print(computer_system.Name)
# print("Components: \n")
# for component in componenten:
# print(component.Name)
# independent this works:
print("Software Environment:\n\n")
print("Systeem Drivers: \n ")
for driver in drivers:
print(driver.Name)
print("\nPrintJob: \n")
for printJob in printJobs:
print(printJob.Name)
print("\nNetwerk connecties: \n")
for netwerkConnectie in netwerkConnecties:
print(netwerkConnectie.Name)
print("\nRunning Tasks: \n")
for runningTask in runningTasks:
print(runningTask.Name)
print("\nServices: \n")
for service in services:
print(service.Name)
print("\nStartup Programs: \n")
for startupProgram in startupPrograms:
print(startupProgram.Name)
I get information about some compenents but not everything I want like the system summary and a summary of components.
Do I have to list them up al seperatly or can I iterate through them? It's hard to find the right WIN32_classes and Visual Studio Code isn't showing me the properties like Name or Caption with intellisense I wander if this is normal behaviour or Pycharm just works better and will show me the properties of the WIN32_classes (haven't tried it yet.).
import wmi
c = wmi.WMI()
# List Win32 classes:
# https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-provider
# How to get a list of system summary and components?
computer_systems = c.Win32_Computersystem()
componenten = c.WIN32_SystemDevices()
drivers = c.Win32_SystemDriver()
printJobs = c.Win32_PrintJob()
netwerkConnecties = c.Win32_NetworkAdapter()
runningTasks = c.Win32_Process()
services = c.Win32_Service()
startupPrograms = c.Win32_StartupCommand()
# print("System Summary: \n\n")
# for computer_system in computer_systems:
# print(computer_system.Name)
# print("Components: \n")
# for component in componenten:
# print(component.Name)
# independent this works:
print("Software Environment:\n\n")
print("Systeem Drivers: \n ")
for driver in drivers:
print(driver.Name)
print("\nPrintJob: \n")
for printJob in printJobs:
print(printJob.Name)
print("\nNetwerk connecties: \n")
for netwerkConnectie in netwerkConnecties:
print(netwerkConnectie.Name)
print("\nRunning Tasks: \n")
for runningTask in runningTasks:
print(runningTask.Name)
print("\nServices: \n")
for service in services:
print(service.Name)
print("\nStartup Programs: \n")
for startupProgram in startupPrograms:
print(startupProgram.Name)
I get information about some compenents but not everything I want like the system summary and a summary of components.