I am using the modern design kill process.
I want to kill chrome edge outlook and excel.
Please provide me the solution for best practises and also dfine “process” and “process object”
You can give the respective process name to kill the processes example chrome for killing chrome excel for excel etc
Process name is the name of process you want to kill…
Process object is the process as an object you can generally get it by usign get processes which gives a list of processes as objects…that can be passed to kill process to kill only a specific instance of process ratehr than all the process of that application at once…
Generally we use applies to currentuser or else on a vm where multiple users login the process gets kill on all ysers …if you choose current user then only for the current user it is killed
Hope this helps
Cheers
can you share one workflow ?
You can define the processes to kill or get using Get Process Activity. You can use array of String or get them from Config
processes = {"chrome", "excel", "msedge", "outlook”}
Cheers
why we need to pass the .exe ?
wat is the significance of passing .exe?
I edited my answer removing the extension
Hi Ritaman_Baral,
If you need to use the Kill Process activity then you need to specify the process that you need to kill.
Remember that adding the extension of the process (“process.exe”) cause the activity fail. For more information you can check here.
Cheers!
Could you try kill the processes with extension ? I tried both in Windows Project and both work without any fails
Hi Henrique,
I know, but if you check the UiPath documentation, they suggest not including the extension because it causes the activity to fail.
Cheers!
Yeah, I took a look at it.
I honestly copy the process name from CMD and it works fine so I presumed that no matter if you add extension or not.
It seems docs is not update. But…. @Ritaman_Baral I edited my earlier answer to no confuse anyone
@jose.ordonez1 thanks for the correction
→ Take an assign activity and give the below syntax:
arr_process= {"chrome","excel","msedge","outlook"}
→ Use For Each loop to iterate through the arr_process and inside the loop use Kill Process and in ProcessName pass the currentItem.
In the above case you need not give any extension like exe. It will kill the process.
If you want you can surround that within Try Catch and in the catch section you can give System.Exception.
If you have any queries, post it here. I will help you out.
Regards
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.