I need to programmatically get a list of running applications as shown in the "Applications" tab inside the Windows Task Manager using PowerShell or VBScript.
All I could find so far is how to list processes using VBScript and WMI.
I need to programmatically get a list of running applications as shown in the "Applications" tab inside the Windows Task Manager using PowerShell or VBScript.
All I could find so far is how to list processes using VBScript and WMI.
@Steven Murawski: I noticed that if I used mainwindowhandle I'd get some process that were running, of course, but not in the "Applications" tab. Like explorer and UltraMon, etc. You could condition off of mainwindowtitle instead, since those process I encountered didn't have window titles -- like so
stahler's answer converted to PowerShell:
$word = new-object -com 'word.application'
$word.tasks | ? {$_.visible} | select name
$word.quit()
This gets you close in PowerShell:
Or the shorter version:
This should do the trick:
http://msdn.microsoft.com/en-us/library/bb212832.aspx
from command line you are looking for:
tasklist /v
the/v
means verbose and will include list of "application running off each processtasklist /v /fi "imagenaem eq POWERPNT.EXE"
for example can be used to filter just application running under POWERPNT.EXE process.