Close all Applications listed in Task Manager

Enoch_Foul

New Member
Hi,

I am wondering if there is a way to identify and kill all tasks which are listed in the Applications Tab of Task manager opposed to the method of killing a process by sending a predefined application name as an input into the Environment Utility - Kill Process?

I am trying to find a quick way to differentiate between non-essential applications and system processes.

It would be helpful if there is a way to identify all the applications running in the Applications Tab of Task Manager (see Figure 1) and then once I have a list of them kill them off one by one.

Thanks
 

Attachments

  • Figure 1.PNG
    Figure 1.PNG
    88.6 KB · Views: 4

Sachin_Kharmale

Active Member
Hi @Jameswilliams ,

if you want to list out the active applications which is running in application tab of task manager.
just follow the bellow steps-
Design code stage which will output as a Collection which contains running application names.
step 1:
Add new action in object add new code stage.
1636373362264.png
step 2:
Code stage output parameter.
1636373388382.png
step 3:
Type given code in code stage.
1636373431974.png
step 4:
Now run the action and get the running application process names in Collection.
1636373479145.png
step 5:
Check the Output.
1636373539940.png
step 6:

Next step if you want to kill the process then loop the collection and kill the process.

I hope it will help you.
 
Last edited:

Enoch_Foul

New Member
Hi @Jameswilliams ,

if you want to list out the active applications which is running in application tab of task manager.
just follow the bellow steps-
Design code stage which will output as a Collection which contains running application names.
step 1:
Add new action in object add new code stage.
View attachment 6062
step 2:
Code stage output parameter.
View attachment 6063
step 3:
Type given code in code stage.
View attachment 6064
step 4:
Now run the action and get the running application process names in Collection.
View attachment 6065
step 5:
Check the Output.
View attachment 6066
step 6:

Next step if you want to kill the process then loop the collection and kill the process.

I hope it will help you.

Hi @Sachin_Kharmale

Thanks for your reply this is exactly what I am looking for, however I have tried to enter the code in BP V6 and v7 and it is appears to be full of compiler errors.
Compile Errors.PNG

It looks like I have typed exactly shown in your example. Any ideas what could be wrong?
Code.PNG

Thanks
 

Sachin_Kharmale

Active Member
Hi @Sachin_Kharmale

I don't suppose you would have the code in VB would you. This object is going to be part of a group of objects which use VB code and if I change it to C# it will stop all the other objects in the set working

Thanks
Hi @Jameswilliams ,

then just replace the code stage code with the bellow given code
No need to change any configuration in object


Dim dt As New DataTable("ActiveApplication")
Dim col As New DataColumn("Application Name", GetType(String))
dt.Columns.Add(col)
For Each p As System.Diagnostics.Process In System.Diagnostics.Process.GetProcesses()
If p.MainWindowTitle.Length > 0 Then
dt.Rows.Add(p.ProcessName.ToString)
End If
Next

RunningApplication = dt

I hope it will help for you .
 

Enoch_Foul

New Member
Hi @Jameswilliams ,

then just replace the code stage code with the bellow given code
No need to change any configuration in object


Dim dt As New DataTable("ActiveApplication")
Dim col As New DataColumn("Application Name", GetType(String))
dt.Columns.Add(col)
For Each p As System.Diagnostics.Process In System.Diagnostics.Process.GetProcesses()
If p.MainWindowTitle.Length > 0 Then
dt.Rows.Add(p.ProcessName.ToString)
End If
Next

RunningApplication = dt

I hope it will help for you .
Amazing @Sachin_Kharmale thanks for your help :)
 
Top