Kill Process "UIDemo"

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
1 Like

HI @skhiremath,

Any one is fine.

Regards,
Arivu

1 Like

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

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

Regards,
Dom :slight_smile:

2 Likes

Thanks @Dominic

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

Reference: https://activities.uipath.com/docs/kill-process

4 Likes

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.

Hi @AJ0207,

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

Hope this helps.
Thanks!

1 Like

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.

1 Like

Please try WINWORD as process name

2 Likes

@Jan_Brian_Despi
It worked. Thank you so much.

1 Like

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

1 Like