How to close all Running applications that can be opened in windows?

Hi Folks,

I want to close all applications (if running) except UiPath studio and UiPath Robot.

I don’t want to care about the number of applications opened in my windows i just want to close all applications except UiPath. Is there any way by which i can do it?

Regards,
Harshit Singh

@harshit_singh

I have code in c#. It may help you. Check the following code.

Process[] processes = Process.GetProcesses();
foreach(Process p in processes)
{
    if(!String.IsNullOrEmpty(p.MainWindowTitle))
    {
        //check for window title, if not uipath or uirobot; close the process
    }
}

Regards,
Karthik Byggari

1 Like