# Kill Process "UIDemo"

**URL:** <https://forum.uipath.com/t/kill-process-uidemo/27157>\
**Category:** Academy Feedback\
**Tags:** system, uiautomation, activities\
**Created:** [March 28, 2018, 7:34am UTC](https://forum.uipath.com/t/kill-process-uidemo/27157 "2018-03-28T07:34:52Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![skhiremath](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/skhiremath/32/9584_2.png) [@skhiremath](https://forum.uipath.com/u/skhiremath)\
**Post date:** [March 28, 2018, 7:34am UTC](https://forum.uipath.com/t/kill-process-uidemo/27157/1 "2018-03-28T07:34:52Z")

</div>

Hi All,  
I’ve been working on the UIDemo assignment and I am using the activity “Kill Process”  
I have warning when I initially drag the activity into the work space. Initially what I have done is:

1. Target =\> ProcessName = “UIDemo.exe”  
The warning disappeared.  
I have a question:
2. Do I need to enter values to both target fields “Process”&”ProcessName”?  
e.g. When I enter values in both the target fields, I still get warning for Process field:  
Target =\> ProcessName = “UIDemo.exe”  
Target =\> Process = System.Diagnostics.Process.GetProcessesByName(““UIDemo.exe””)  
Warning: Compiler error encountered processing expression System.Diagnostics.Process.GetProcessesByName(““UIDemo.exe””). value of type '1 -dimensional array of ‘System.Diagnostics.Process’ cannot be converted to ‘System.Diagnostics.Process’  
Could anyone help me out with a brief explanation ?  
Many Thanks,  
Sanjay

---

<div class="post-metadata">

**Author:** ![arivu96](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@arivu96](https://forum.uipath.com/u/arivu96)\
**Post date:** [March 28, 2018, 7:37am UTC](https://forum.uipath.com/t/kill-process-uidemo/27157/2 "2018-03-28T07:37:31Z")

</div>

HI @skhiremath,

> [@skhiremath](#):
>
> Do I need to enter values to both target fields “Process”&”ProcessName”?

Any one is fine.

Regards,  
Arivu

---

<div class="post-metadata">

**Author:** ![skhiremath](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/skhiremath/32/9584_2.png) [@skhiremath](https://forum.uipath.com/u/skhiremath)\
**Post date:** [March 28, 2018, 7:42am UTC](https://forum.uipath.com/t/kill-process-uidemo/27157/3 "2018-03-28T07:42:30Z")

</div>

@arivu96, I will just use the “ProcessName” then. Thanks for your suggestion.

---

<div class="post-metadata">

**Author:** ![Dominic](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/dominic/32/461400_2.png) [@Dominic](https://forum.uipath.com/u/Dominic)\
**Post date:** [March 28, 2018, 7:51am UTC](https://forum.uipath.com/t/kill-process-uidemo/27157/4 "2018-03-28T07:51:19Z")

</div>

For the people who finds it challenge to understand both (Process & ProcessName). We have already posts regarding this in forum with some clear explanation,

> [@How to use Kill Process](https://forum.uipath.com/t/how-to-use-kill-process/5743/4):
>
> You have to pass either Process or ProcessName. For Instance if you have to Close outlook Use GetProcesses (collection) and loop it untill you get your Proccesses and kill them (multiple) using Kill Process [image] Kill one process use Kill Process Activity and pass one of below process = System.Diagnostics.Process.GetProcessesByName(“OUTLOOK”) —\> process “OUTLOOK” —\> processname

> [@How to use Kill Process](https://forum.uipath.com/t/how-to-use-kill-process/5743/9):
>
> Hi @hellitonwoo Process is the process type object to be selected to kill. As you can see in the error message, it is recommended to use “Is” instead of “=”, but this would retrieve a boolean value that would not be compatible to the System.Diagnostics.Process type. So you could just write System.Diagnostics.Process.GetProcessesByName(“chrome”)(0) – it will kill the first chrome process in the AllProcesses list. Or a much simple solution would be to give directly the ProcessName as string: ju…

Regards,  
Dom 🙂

---

<div class="post-metadata">

**Author:** ![skhiremath](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/skhiremath/32/9584_2.png) [@skhiremath](https://forum.uipath.com/u/skhiremath)\
**Post date:** [March 28, 2018, 7:53am UTC](https://forum.uipath.com/t/kill-process-uidemo/27157/5 "2018-03-28T07:53:20Z")

</div>

Thanks @Dominic

---

<div class="post-metadata">

**Author:** ![tang](https://avatars.discourse-cdn.com/v4/letter/t/e8c25b/32.png) [@tang](https://forum.uipath.com/u/tang)\
**Post date:** [February 15, 2019, 2:47pm UTC](https://forum.uipath.com/t/kill-process-uidemo/27157/6 "2019-02-15T14:47:54Z")

</div>

Adding the “.exe” to “UiDemoPath” might be causing some problems. Just leave the “.exe” off. 🙂

 ![](https://global.discourse-cdn.com/uipath/original/3X/e/6/e6674532fa47cd4778b6f2a29608537ba83bef6e.png)

Reference: [https://activities.uipath.com/docs/kill-process](https://activities.uipath.com/docs/kill-process)

---

<div class="post-metadata">

**Author:** ![AJ0207](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/aj0207/32/64584_2.png) [@AJ0207](https://forum.uipath.com/u/AJ0207)\
**Post date:** [April 11, 2019, 6:41am UTC](https://forum.uipath.com/t/kill-process-uidemo/27157/7 "2019-04-11T06:41:54Z")

</div>

Hi Dominic,

Can you please tell me how to kill word documents? I tried the above mentioned methods but it doesn’t seem to be working. Also I am getting the error “Value of type 1-dimensional array cannot be converted to System.Diagnostics.Process”. Please help me out on this.

---

<div class="post-metadata">

**Author:** ![Jan\_Brian\_Despi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/jan_brian_despi/32/535308_2.png) [@Jan\_Brian\_Despi](https://forum.uipath.com/u/Jan_Brian_Despi)\
**Post date:** [April 11, 2019, 7:01am UTC](https://forum.uipath.com/t/kill-process-uidemo/27157/8 "2019-04-11T07:01:56Z")

</div>

Hi @AJ0207,

Please try using the **Kill Process** activity and use **“Microsoft Word”** as **Process Name**

Hope this helps.  
Thanks!

---

<div class="post-metadata">

**Author:** ![AJ0207](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/aj0207/32/64584_2.png) [@AJ0207](https://forum.uipath.com/u/AJ0207)\
**Post date:** [April 11, 2019, 8:39am UTC](https://forum.uipath.com/t/kill-process-uidemo/27157/9 "2019-04-11T08:39:17Z")

</div>

Hi @Jan_Brian_Despi,

I have tried using “Microsoft Word” in the process name, but again it does not work. Though it does not throw any error,but it still doesn’t close any of the word documents. But all other files like Excel and Outlook do close when I use them respectively as process names. Could you please check and tell if it’s working for you?

Thanks.

---

<div class="post-metadata">

**Author:** ![Jan\_Brian\_Despi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/jan_brian_despi/32/535308_2.png) [@Jan\_Brian\_Despi](https://forum.uipath.com/u/Jan_Brian_Despi)\
**Post date:** [April 11, 2019, 8:51am UTC](https://forum.uipath.com/t/kill-process-uidemo/27157/10 "2019-04-11T08:51:52Z")

</div>

Please try WINWORD as process name

---

<div class="post-metadata">

**Author:** ![AJ0207](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/aj0207/32/64584_2.png) [@AJ0207](https://forum.uipath.com/u/AJ0207)\
**Post date:** [April 11, 2019, 9:01am UTC](https://forum.uipath.com/t/kill-process-uidemo/27157/11 "2019-04-11T09:01:09Z")

</div>

@Jan_Brian_Despi  
It worked. Thank you so much.

---

<div class="post-metadata">

**Author:** ![Jan\_Brian\_Despi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/jan_brian_despi/32/535308_2.png) [@Jan\_Brian\_Despi](https://forum.uipath.com/u/Jan_Brian_Despi)\
**Post date:** [April 11, 2019, 9:01am UTC](https://forum.uipath.com/t/kill-process-uidemo/27157/12 "2019-04-11T09:01:45Z")

</div>

No problem, @AJ0207.  
Feel free to comsult me anytime 🙂
