Solved How to kill a process?

May 28, 2015 at 07:45:54
Specs: Windows 7
I need to terminate a process using taskkill (or something similar) that I can then set up to run in scheduler.

I can kill it in task manager no problem but get an "access denied" error if I try the same with taskkill.

Any suggestions?


See More: How to kill a process?

Report •

✔ Best Answer
June 2, 2015 at 10:10:35
TASKKILL /F /IM first.exe & TIMEOUT /T 10 & TASKKILL /F /IM second.exe

How To Ask Questions The Smart Way



#1
May 28, 2015 at 07:53:54
Let us know what process you are trying to kill.

Always pop back and let us know the outcome - thanks


Report •

#2
May 28, 2015 at 07:57:01
hauppaugetvserver.exe

Part of a TV capture tuner. If left running after recording has completed it sometimes locks up and will not allow another program to be captured. Killing it allows restart with no issues.

I even tried checking off all permissions for the process and still no luck.

Could this be some kind of administration issue? But it does work fine under Task Manager.

message edited by Scooterspal


Report •

#3
May 28, 2015 at 07:58:14
TASKKILL /F /IM hauppaugetvserer.exe

?

How To Ask Questions The Smart Way


Report •

Related Solutions

#4
May 28, 2015 at 08:01:48
That's what I'm using now with and without quotes. Access denied.

message edited by Scooterspal


Report •

#5
May 28, 2015 at 08:28:56
Is it possible to write a .bat file to open Task Manager and kill it from there? Seems the only way this will work unless someone has a suggestion.

Report •

#6
May 28, 2015 at 09:25:21
hauppaugetvserer.exe is a long file name (greater than 8 characters) so I think you need to put quotes around it. Someone will tell us if the taskkill command is some sort of exception to the rule.

Always pop back and let us know the outcome - thanks


Report •

#7
May 28, 2015 at 09:28:14
Yes, as I stated I have tried it with and without the quotes. Access denied.

Report •

#8
May 28, 2015 at 09:31:12
OK, I'm not 100% about that. Some ideas here:
http://superuser.com/questions/1090...

Always pop back and let us know the outcome - thanks


Report •

#9
May 28, 2015 at 09:58:00
So I read (actually re-read it from last night) this article Derek posted.

Downloaded the Systernals set of apps and loaded Pskill into the C directory. In CMD I ran it as pskill "hauppaugetvserver.exe" and it killed the process.

Eureka right? Nope.

It would not do it a second time. Will not do it again no matter how many times I try it. Get the same Access Denied error.

What gives?

message edited by Scooterspal


Report •

#10
May 28, 2015 at 10:50:43
I'm just going to assume "hauppaugetvserver.exe" isn't running under your session, and thus you're hitting UAC. Try killing it from an elevated prompt.

How To Ask Questions The Smart Way


Report •

#11
May 28, 2015 at 10:54:25
Sorry, can you be more specific. What do you mean by elevated prompt?

Report •

#12
May 28, 2015 at 11:12:31
Find your Command Prompt icon, right-click, select Run as Administrator. . . You should get a window that says, "Administrator: Command Prompt". Try killing the process from that window.

How To Ask Questions The Smart Way


Report •

#13
May 28, 2015 at 11:33:02
Another idea. Running from task scheduler (assuming that's what you had in mind in your original post) can be a way of avoiding UAC and possibly your "Access Denied". See here:
http://www.7tutorials.com/use-task-...

Always pop back and let us know the outcome - thanks


Report •

#14
May 28, 2015 at 14:05:10
Thank you. These are both goods ideas that I will try.

Right now the systems are running (capturing) so I cannot test either of these. I will do so in the AM and report back.

Much appreciated : )


Report •

#15
June 2, 2015 at 08:01:11
OK. So opening CMD by right clicking on icon gets me in as administrator and, yes, I can now terminate with wild abandon. Thank you for that : )

Have not tested using scheduler, which according to Dereks article, seems to allow one to do something similar using a check box.

Question: I may have to terminate two .exe's now to make this work, one after the other.

1) can I do this in the same line and how?

2) can I insert a time delay.. certain number of seconds... between the first terminate and the second... and how?

Thanks much.

message edited by Scooterspal


Report •

#16
June 2, 2015 at 08:25:50
You need to keep them separate if you are using "Task Scheduler". They should then run from either a command line or shortcut without the UAC confirmation popup.

The only way I can see to have delay between them is to either use a batch file or AutoHotkey (see Google) which uses the newly produced shortcut lines. That way you can interject a pause or delay between the first and second processes.

Always pop back and let us know the outcome - thanks


Report •

#17
June 2, 2015 at 10:10:35
✔ Best Answer
TASKKILL /F /IM first.exe & TIMEOUT /T 10 & TASKKILL /F /IM second.exe

How To Ask Questions The Smart Way


Report •

#18
June 5, 2015 at 11:40:48
Razor:

Thanks. Worked exactly as advertised. Set it for 5 seconds between each terminate and they each restore on their own one after the other. This will now guarantee neither program is locked up preventing the next recording from taking place.

Timing was critical since terminating one program was causing it to make a second copy of the other. With two copies running it prevented a new recording from starting. Now, even though it still makes that second copy one of them (not sure which) gets killed so only one is left standing.

Trying to get the Hauppauge people to add this to their software/driver but so far little interest.

Let me add that even though I had to pick one answer... the site kept bugging me to do so... I appreciate all the help given from the others here.

You're are all the best!

message edited by Scooterspal


Report •

#19
June 5, 2015 at 14:34:07
Glad to hear it worked and thanks for popping back to let us know.

message edited by Derek


Report •

Ask Question