List running services

You can use below script to list all running services,(Windows XP OS not supported)

import subprocess;
process=subprocess.Popen(['wmic','service','get','caption,','name,','state'],stdout=subprocess.PIPE);
for line in iter(process.stdout.readline,''):
    print line.rstrip();

Note: Please refer attach text file for script text without indentation error.

sample output would be as below,

running_services.txt (196 Bytes)