Is there anyway to kill "Administrator cmd.exe" using taskill on batch programming?

206 Views Asked by At

I am using the command,

taskkill /IM cmd.exe

using above command it will kill cmd.exe windows which are all open.

But, my question is, How do I kill administrator command prompt using taskkill command ?

above mentioned command doesn't working for elevated cmd.exe

2

There are 2 best solutions below

0
Gaurav D Verma On

Run command prompt as administrator and then execute taskkill /IM cmd.exe

0
Dominique On

Whatever you do, you need an administrator prompt in order to be able to do this.
I just tried following command:

taskkill /S System /U "administrator" /IM cmd.exe

... but I received "ERROR: The RPC server is unavailable.". Next point will be the explanation of that error message and how to handle it, or maybe it works for you?