Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get list of running applications using PowerShell or VBScript

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.

like image 584
mal99 Avatar asked Oct 10 '08 13:10

mal99


People also ask

How do I list running processes in PowerShell?

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.

Which PowerShell command provide the list of running services?

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.

How do I get a list of installed programs on a remote computer using PowerShell?

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.


2 Answers

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
like image 155
Steven Murawski Avatar answered Sep 19 '22 07:09

Steven Murawski


@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
like image 45
EdgeVB Avatar answered Sep 19 '22 07:09

EdgeVB