Component To closes all Running applications that can be opened in windows, except Uipath Studio +UiRobot

Hey Folks

Here i am sharing a simple workflow script which will kill all running application process on windows instead of All process like windows services.

It will be helpful where we want to close all other running applications(like pdf, chrome, Edge,Internet Explorer, spotify, etc) for a fresh start of our robot or setting a stage for robot to run in a clean environment :slight_smile:

Note: we can kill the file explorer of windows as well but it is a required process by windows(it is a windows os required process) so even if we will try to kill it, it will get restart :slight_smile:

Kill All running process except one.xaml (8.2 KB)

Regards…!!
Aksh

6 Likes

Hello,

One question, could it be done without a kill process, and with a Close application?

Thanks!

Well we will close the process with Closewindow but CloseMainWindow does not force the application to quit. The application can ask for user verification before quitting, or it can refuse to quit.

The Close method causes the process to stop waiting for exit if it was waiting, closes the process handle, and clears process-specific properties. Close does not close the standard output, input, and error readers and writers in case they are being referenced externally.

Kill forces a termination of the process without any quit prompt.

So if you are ready to handle at your end the application quit prompt then you can use CloseMainWindow.
Otherwise better to clear all application forcefully :slight_smile:

Regards…!!
Aksh

1 Like

When I tried this, the robot seems to try to kill UiPath.Executor, may be UiPath.Executor should be added to the list upon usage :wink:

After reading post provided :slight_smile: i’m not able to figure out. It kills some of my local application and giving an error "RemoteException wrapping System.Exception: Job stopped with an unexpected exit code: 0xFFFFFFFF " is there a way to kill my rdp application before the program throw out with error. (using try catch activity)