Please use the script to know whether a application is running on your target machine
import os
def IsAppRunning(appName):
proObj = os.popen('TASKLIST /FI "USERNAME ne NT AUTHORITY\SYSTEM" /FI "STATUS eq running"')
runApps = proObj.read()
return appName in runApps
def main():
## Pass application name with '.exe' extension
appName = 'chrome.exe'
if IsAppRunning(appName):
print 'Success: '+appName+' is running'
else:
print 'Fail: '+appName+' is not running'
if __name__ == '__main__':
main()
Usage:
pass your app name in appName variable that you want to check out that whether running or not
Sample output:
Exported Script:
20161226-App-running.json (796 Bytes)