- Install pywin32 to support wmi commands
- import wmi in python code
- Open Python Terminal
- Type pip install pywin32 and press enter. This will install pywin32
import wmi c = wmi.WMI () for s in c.Win32_Service (): if s.State == 'Stopped': print(s.Caption, s.State)