Hi,
I'm testing a desktop application using RS 5.2
I'm trying to kill some process after closing the application and i found some trouble there.
The error message show that i don't have enough privilege to execute the System.Diagnostics.Process.Kill() Sub, knowing that I'm using the administrator user of the Operating system.
Do I need some specified configuration for Ranorex ?
her is the Sud :
Public Sub killProcess()
For Each prog As Process In Process.GetProcesses
If prog.ProcessName = "processName" Then
prog.Kill()
prog.WaitForExit()
Report.Info("Killing the '" &prog.ProcessName & "' Process ")
End If
Next
End Sub
Regards,
Using System.Diagnostics.Process.Kill process
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Using System.Diagnostics.Process.Kill process
Hello Obessrour,
It seems like you don't have the necessary permission to “kill” the process. Please ensure that you are running your test/script with elevated rights. Even if you are running your script with Admin rights you won’t be able to kill “system critical” processes. You don’t need a special configuration of Ranorex in order to use the System.Diagnostics.Process.Kill()-method.
Regards,
Robert
It seems like you don't have the necessary permission to “kill” the process. Please ensure that you are running your test/script with elevated rights. Even if you are running your script with Admin rights you won’t be able to kill “system critical” processes. You don’t need a special configuration of Ranorex in order to use the System.Diagnostics.Process.Kill()-method.
Regards,
Robert
Re: Using System.Diagnostics.Process.Kill process
Hi Robert,
Thanks for your Response
Could you please clarify what did you mean by " Please ensure that you are running your test/script with elevated rights." ?
Best,
Thanks for your Response

Could you please clarify what did you mean by " Please ensure that you are running your test/script with elevated rights." ?
Best,
Re: Using System.Diagnostics.Process.Kill process
Elevated rights = Administrator type account. They are the only type of accounts that can end a process they don't own. You should be using an account with Administrator privileges to run tests.
Shortcuts usually aren't...
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Using System.Diagnostics.Process.Kill process
Hello,
@krstcs
Thank you for answering the question. You are right.
Regards,
Robert
@krstcs
Thank you for answering the question. You are right.

Regards,
Robert