2

Courtesy of some buggy third party software, we regularly (and frustratingly) have a task that sits in Task Manager and cannot be killed - all attempts to do so result in "Access denied". This question is really informative about what may be occurring... and what one might be able to do about it - e.g. invoke PsExec -s taskkill /im MyTask.exe /f

Can that wisdom be distilled into a "kill MyTask" shortcut to a cmd file so that a user can kill the program with a double-click? What are the contents of the cmd file? All of my attempts so far have been blocked by variations on "Access Denied" - if not for the task itself, then for PsExec. The account I am trying to run my script from has Administrator rights.

omatai
  • 313
  • 5
  • 18

1 Answers1

0

Not for the user themselves. The "Access Denied" error happens because the user themselves do not have sufficient privileges to run these programs. If they were, they could use the task manager themselves and kill the process that way.

You may be able to use Microsoft Application Compatibility Toolkit in order to "grant rights" to run a program and thus allowing them to run your script.

If you do all this, and it still doesn't work, make sure you run your script as administrator, otherwise it will still run as the user with limited access.

LPChip
  • 59,229
  • 10
  • 98
  • 140
  • Is this true even if the user has Administrator rights? I find it really confusing that I have Administrator rights, can start this program, but cannot stop it!! – omatai Jul 11 '15 at 00:04
  • psexec -s runs a task as system, something that requires administrative access. You are doing right-click -> run as administrator on your script, right? – LPChip Jul 11 '15 at 11:08
  • Ummm.... I am now :-) oops... – omatai Jul 12 '15 at 10:06
  • I've updated my answer to reflect this. If this did the trick, feel free to accept the answer. :) – LPChip Jul 12 '15 at 10:47