I am trying to kill a task but in order to do it I need admin privileges.
And so far I was not able to find a functional code that would bypass the need for admin. And when I found one than it was filled with errors or was made for python 2.
I am trying to kill a task but in order to do it I need admin privileges.
And so far I was not able to find a functional code that would bypass the need for admin. And when I found one than it was filled with errors or was made for python 2.
I was not able to find a functional code that would bypass the need for admin
Assuming that you have admin privileges on your system, you can run your script with evaluated privileges as detailed in this answer. Otherwise, aside from exploits specific to your version of Windows, it is not possible to "bypass" the need for admin.
As for not being able to use code written in Python 2, you can always convert code between between Python versions. This can be done manually or using an automated tool such as the standard 2to3
program that ships with CPython.
One other side note: the infinite loop in the sample of code that you posted would normally be written as
while True:
# body statements
Using 1
in place of True
still works as non-zero integers are "truthy" when evaluated in a context where a boolean expression is expected.