Could anyone helps me to fetch the Apps name and all the Processes opened by the App? Just like the Task Manager shows.
Can you give me an example in Java, Python or Powershell? I have tried the ways from internet, but I can only fetch the processes name, I also want to get the apps name as well.
These are what I tried:
- Powershell: Get-Process
- Python:
import psutil
# Define the app group name
app_group = 'Visual Studio Code'
# Get a list of all running processes
processes = psutil.process_iter()
for process in processes:
print(f'Process ID: {process.pid}')
print(f'Process Name: {process.name()}')
2
Answers
I find out 2 solution so far:
Solution Result 1
We can use
pslist64.exe -t
from Sysinternals.Solution Result 2 - powershell
Solution Result 2 - powershell
Is PS, you can just do this.
Update
Grouping
Update
Process details
Update
Group data and details.
Update as per my comment about the child-parent resolution approach.
Or even this way.
Then of course use the
Group-Object
cmdlet already shown earlier.