Which one do you prefer ? CloseApplication or KillProcess

Hi,

I have been lately curious about which method generally you use for closing applications?KillProcess or CloseApplications or maybe another?

I have seen lots of topics about its advantages and disadvantages. However, I think kill process is the best way and i do not use close application. For close application, you should think scenario for all apps to close. Kill process is the easy way. But I would like to learn what the general opinion is. This topic’ intention is not learning about its advantages or disadvantages, it is about which one do you use and why?

Here is the UiPath Tutorial :

Hi, in my opinion, the first thing to do is to close the Application / Browser in a safe manner, i.e. save the file and clear the program / browser cache by the program itself.
Then, if the operation fails, use the Kill Process activity.

Everything can be closed in the Try Catch module.

Try: Close
Catch: Kill
Finally: null or something to do.

image

2 Likes

Additionally it should be mentioned that - kill - can also cause unwanted behaviours at the next start of an application like a crash report.
So it is always important to understand how a kill interacts with your applications and if additional handling is needed.

But what @Adrian_Star is a general best practice that can be used.

1 Like