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.
Get-Process: Display Processes in PowerShell You can use the Cmdlet Get-Process to display all running processes on a computer. By default, the list of processes is sorted alphabetically in descending order.
Open an elevated PowerShell console, type Get-Service and hit Enter. You will see a list of all the Services installed on your Windows system.
Using Powershell script: Thru WMI object: Get-WmiObject -Class Win32_Product -Computer RemoteComputerName. thru Registry: Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize.
This gets you close in PowerShell:
get-process | where-object {$_.mainwindowhandle -ne 0} | select-object name, mainwindowtitle
Or the shorter version:
gps | ? {$_.mainwindowhandle -ne 0} | select name, mainwindowtitle
@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
gps | ? {$_.mainwindowtitle.length -ne 0} | select name, mainwindowtitle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With