Kill process access denied

Hi, I am getting an error of “access denied” when I try and kill EXCEL or iexpore. I am Logged in as admin and have tried multiple .net ways but it still says access denied.

It’s possible the process is being used by another logon session. - I’m assuming you are using a server with multiple users?

You could check out the “Kill Processes per user”, which kills the process only in the current user session:


Also, you can set the ContinueOnError to True if you don’t want the Kill Process to error. However, using an admin account could cause problems on a server, because it will kill the processes for all users.

Hi mate, Yes im on a dev bopx with multiple developers. I checked the link. It seems alot of code for this. I can assume its all neccisarry but is there a simpler way? that has the same outcome

As I understand, you need to kill the processes that are only on that logon session. So in order to do that, you need to assign the session id, and kill all processes that contain that session id.

I don’t think the code is really too complex. You can choose to use the Array argument to send it just excel and iexplore, instead of using a text file that contains all the processes. So there are options.

And, if you don’t know what the process name is, it outputs all the processes to the Output pane.

Also, if you have any suggestions, I can update that component, so let me know. But feel free to extract parts of the code from the component if you desire to only use a portion of it.


ok thank you. What are your thoughts on invoke powershell to do the same? i am use to powershell more so

I like scripting solutions, but I also like easy and user-friendliness. So, you would probably want the solution to be deployed in a way which makes it simple to re-use the solution among all future RPA projects.

Like you would not want to create a copy of the script for each solution. You probably also don’t want to just share it somewhere on the network, cause the location path could change in the future and you lose some version control.

Then, you would also need to Invoke the Powershell for each project anyway.

But, when it comes down to it, you want to deploy your kill process solution that makes it accessible to all projects and also easily updated.

In terms of UiPath, creating a Library from a workflow component or creating a custom activity, allows you to have that accessibility and maintainability. There are probably different ways to get that from script solutions too, but you are probably more familiar with the script solutions than I :grin:

Thank you mate.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.