How to use pskill or kill ... to kill a process with a name like "Hello There"

F

flahmeshess

Hi !

Normally, I find that a process would have a image name like
svchost.exe. But I have a program which does not have extension and
has a space in it, eg "Hello There" (not the real image name).
I try to use pskill or kill command to remove it but it does not
work. I don't want to kill it by the taskid as I want to kill it via
a batch.
So any advice how to kill such procoesses ?

Thanks a lot.
 
F

flahmeshess

Yes. Already tried... pskill says Process does not exist.
Kill - no output but process still running.
 
P

Pegasus \(MVP\)

flahmeshess said:
Hi !

Normally, I find that a process would have a image name like
svchost.exe. But I have a program which does not have extension and
has a space in it, eg "Hello There" (not the real image name).
I try to use pskill or kill command to remove it but it does not
work. I don't want to kill it by the taskid as I want to kill it via
a batch.
So any advice how to kill such procoesses ?

Thanks a lot.

Kill it by its process number. TList.exe or tasklist.exe will give
you the number.
 
F

flahmeshess

But I dont' want to kill by process number if possible. The reason is
that I'm running it in a batch and I can't hardcode the process
number.
 
P

Pegasus \(MVP\)

That's no valid reason at all! The following batch file will
do exactly what you want:

@echo off
for /F %%a in ('tlist ^| find /i "Outlook"') do echo kill %%a

Remove the word "echo" in order to activate the kill command.
 
F

flahmeshess

Thanks. Yet to try this cause I use the pskill or kill command. Don't
have the tlist command. Will search for it. Thanks again.
 
F

flahmeshess

Thanks for the help. I found that there is a space at the back of the
process. So when I just use quote and add a space, pskill is able to
kill the process. Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top