View Full Version : close a program with cmd


JT
03-03-2004, 06:47 PM
Hi, I need to close a program with the cmd on a win xp, dose someone have an
Idea

03-03-2004, 07:07 PM
"JT" <J.ct@gmx.net> wrote in message
news:c25983$d8t$07$1@news.t-online.com...
> Hi, I need to close a program with the cmd on a win xp, dose someone have
> an
> Idea

XP includes tskill and taskkill to kill a running program.

Ends a process.

TSKILL processid | processname [/SERVER:servername] [/ID:sessionid | /A]
[/V]

processid Process ID for the process to be terminated.
processname Process name to be terminated.
/SERVER:servername Server containing processID (default is current).
/ID or /A must be specified when using processname
and /SERVER
/ID:sessionid End process running under the specified session.
/A End process running under ALL sessions.
/V Display information about actions being performed.

TASKKILL [/S system [/U username [/P [password]]]]
{ [/FI filter] [/PID processid | /IM imagename] } [/F] [/T]

Description:
This command line tool can be used to end one or more processes.
Processes can be killed by the process id or image name.

Parameter List:
/S system Specifies the remote system to connect to.

/U [domain\]user Specifies the user context under which
the command should execute.

/P [password] Specifies the password for the given
user context. Prompts for input if omitted.

/F Specifies to forcefully terminate
process(es).

/FI filter Displays a set of tasks that match a
given criteria specified by the filter.

/PID process id Specifies the PID of the process that
has to be terminated.

/IM image name Specifies the image name of the process
that has to be terminated. Wildcard '*'
can be used to specify all image names.

/T Tree kill: terminates the specified process
and any child processes which were started by it.

/? Displays this help/usage.

Filters:
Filter Name Valid Operators Valid Value(s)
----------- --------------- --------------
STATUS eq, ne RUNNING | NOT RESPONDING
IMAGENAME eq, ne Image name
PID eq, ne, gt, lt, ge, le PID value
SESSION eq, ne, gt, lt, ge, le Session number.
CPUTIME eq, ne, gt, lt, ge, le CPU time in the format
of hh:mm:ss.
hh - hours,
mm - minutes, ss - seconds
MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB
USERNAME eq, ne User name in [domain\]user
hh - hours,
mm - minutes, ss - seconds
MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB
USERNAME eq, ne User name in [domain\]user
format
MODULES eq, ne DLL name
SERVICES eq, ne Service name
WINDOWTITLE eq, ne Window title

NOTE: Wildcard '*' for the /IM switch is accepted only with filters.

NOTE: Termination of remote processes will always be done forcefully
irrespective of whether /F option is specified or not.

Examples:
TASKKILL /S system /F /IM notepad.exe /T
TASKKILL /PID 1230 /PID 1241 /PID 1253 /T
TASKKILL /F /IM notepad.exe /IM mspaint.exe
TASKKILL /F /FI "PID ge 1000" /FI "WINDOWTITLE ne untitle*"
TASKKILL /F /FI "USERNAME eq NT AUTHORITY\SYSTEM" /IM notepad.exe
TASKKILL /S system /U domain\username /FI "USERNAME ne NT*" /IM *
TASKKILL /S system /U username /P password /FI "IMAGENAME eq note*"

03-03-2004, 07:07 PM
"JT" <J.ct@gmx.net> wrote in message
news:c25983$d8t$07$1@news.t-online.com...
> Hi, I need to close a program with the cmd on a win xp, dose someone have
> an
> Idea

XP includes tskill and taskkill to kill a running program.

Ends a process.

TSKILL processid | processname [/SERVER:servername] [/ID:sessionid | /A]
[/V]

processid Process ID for the process to be terminated.
processname Process name to be terminated.
/SERVER:servername Server containing processID (default is current).
/ID or /A must be specified when using processname
and /SERVER
/ID:sessionid End process running under the specified session.
/A End process running under ALL sessions.
/V Display information about actions being performed.

TASKKILL [/S system [/U username [/P [password]]]]
{ [/FI filter] [/PID processid | /IM imagename] } [/F] [/T]

Description:
This command line tool can be used to end one or more processes.
Processes can be killed by the process id or image name.

Parameter List:
/S system Specifies the remote system to connect to.

/U [domain\]user Specifies the user context under which
the command should execute.

/P [password] Specifies the password for the given
user context. Prompts for input if omitted.

/F Specifies to forcefully terminate
process(es).

/FI filter Displays a set of tasks that match a
given criteria specified by the filter.

/PID process id Specifies the PID of the process that
has to be terminated.

/IM image name Specifies the image name of the process
that has to be terminated. Wildcard '*'
can be used to specify all image names.

/T Tree kill: terminates the specified process
and any child processes which were started by it.

/? Displays this help/usage.

Filters:
Filter Name Valid Operators Valid Value(s)
----------- --------------- --------------
STATUS eq, ne RUNNING | NOT RESPONDING
IMAGENAME eq, ne Image name
PID eq, ne, gt, lt, ge, le PID value
SESSION eq, ne, gt, lt, ge, le Session number.
CPUTIME eq, ne, gt, lt, ge, le CPU time in the format
of hh:mm:ss.
hh - hours,
mm - minutes, ss - seconds
MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB
USERNAME eq, ne User name in [domain\]user
hh - hours,
mm - minutes, ss - seconds
MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB
USERNAME eq, ne User name in [domain\]user
format
MODULES eq, ne DLL name
SERVICES eq, ne Service name
WINDOWTITLE eq, ne Window title

NOTE: Wildcard '*' for the /IM switch is accepted only with filters.

NOTE: Termination of remote processes will always be done forcefully
irrespective of whether /F option is specified or not.

Examples:
TASKKILL /S system /F /IM notepad.exe /T
TASKKILL /PID 1230 /PID 1241 /PID 1253 /T
TASKKILL /F /IM notepad.exe /IM mspaint.exe
TASKKILL /F /FI "PID ge 1000" /FI "WINDOWTITLE ne untitle*"
TASKKILL /F /FI "USERNAME eq NT AUTHORITY\SYSTEM" /IM notepad.exe
TASKKILL /S system /U domain\username /FI "USERNAME ne NT*" /IM *
TASKKILL /S system /U username /P password /FI "IMAGENAME eq note*"

Torgeir Bakken (MVP)
03-03-2004, 07:55 PM
xpert@mailshell13.mailshell.com wrote:

> "JT" <J.ct@gmx.net> wrote:
> > Hi, I need to close a program with the cmd on a win xp, dose someone
> > have an Idea
>
> XP includes tskill and taskkill to kill a running program.

Hi

Note that taskkill (and I would think tskill also) does not
come with WinXP Home.

An alternative:

PsKill.exe in the free PsTools suite at http://www.sysinternals.com/


--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx

Torgeir Bakken (MVP)
03-03-2004, 07:55 PM
xpert@mailshell13.mailshell.com wrote:

> "JT" <J.ct@gmx.net> wrote:
> > Hi, I need to close a program with the cmd on a win xp, dose someone
> > have an Idea
>
> XP includes tskill and taskkill to kill a running program.

Hi

Note that taskkill (and I would think tskill also) does not
come with WinXP Home.

An alternative:

PsKill.exe in the free PsTools suite at http://www.sysinternals.com/


--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx

JT
03-03-2004, 10:24 PM
"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> schrieb im
Newsbeitrag news:40463825.3B40049C@hydro.com...
> xpert@mailshell13.mailshell.com wrote:
>
> > "JT" <J.ct@gmx.net> wrote:
> > > Hi, I need to close a program with the cmd on a win xp, dose someone
> > > have an Idea
> >
> > XP includes tskill and taskkill to kill a running program.
>
> Hi
>
> Note that taskkill (and I would think tskill also) does not
> come with WinXP Home.
>
> An alternative:
>
> PsKill.exe in the free PsTools suite at http://www.sysinternals.com/
>
>
> --
> torgeir
> Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of the 1328 page
> Scripting Guide:
> http://www.microsoft.com/technet/community/scriptcenter/default.mspx
>

thanks for the fast answer, you helped me a lot

JT
03-03-2004, 10:24 PM
"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> schrieb im
Newsbeitrag news:40463825.3B40049C@hydro.com...
> xpert@mailshell13.mailshell.com wrote:
>
> > "JT" <J.ct@gmx.net> wrote:
> > > Hi, I need to close a program with the cmd on a win xp, dose someone
> > > have an Idea
> >
> > XP includes tskill and taskkill to kill a running program.
>
> Hi
>
> Note that taskkill (and I would think tskill also) does not
> come with WinXP Home.
>
> An alternative:
>
> PsKill.exe in the free PsTools suite at http://www.sysinternals.com/
>
>
> --
> torgeir
> Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of the 1328 page
> Scripting Guide:
> http://www.microsoft.com/technet/community/scriptcenter/default.mspx
>

thanks for the fast answer, you helped me a lot

03-04-2004, 06:03 AM
"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:40463825.3B40049C@hydro.com...
> xpert@mailshell13.mailshell.com wrote:
>
>> "JT" <J.ct@gmx.net> wrote:
>> > Hi, I need to close a program with the cmd on a win xp, dose someone
>> > have an Idea
>>
>> XP includes tskill and taskkill to kill a running program.
>
> Hi
>
> Note that taskkill (and I would think tskill also) does not
> come with WinXP Home.

I'm pretty sure tskill is in both HE and Pro while TaskKill is pro only. At
least that's how I remember it. I only used HE for about a week during the
beta.

I do wish there was a list of diffs. someplace though...

03-04-2004, 06:03 AM
"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:40463825.3B40049C@hydro.com...
> xpert@mailshell13.mailshell.com wrote:
>
>> "JT" <J.ct@gmx.net> wrote:
>> > Hi, I need to close a program with the cmd on a win xp, dose someone
>> > have an Idea
>>
>> XP includes tskill and taskkill to kill a running program.
>
> Hi
>
> Note that taskkill (and I would think tskill also) does not
> come with WinXP Home.

I'm pretty sure tskill is in both HE and Pro while TaskKill is pro only. At
least that's how I remember it. I only used HE for about a week during the
beta.

I do wish there was a list of diffs. someplace though...

Mike Brown - Process Manager
03-04-2004, 07:02 PM
<xpert@mailshell13.mailshell.com> wrote in message
news:ugaq85aAEHA.212@TK2MSFTNGP12.phx.gbl...
> "Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
> news:40463825.3B40049C@hydro.com...
> > xpert@mailshell13.mailshell.com wrote:
> >
> >> "JT" <J.ct@gmx.net> wrote:
> >> > Hi, I need to close a program with the cmd on a win xp, dose someone
> >> > have an Idea
> >>
> >> XP includes tskill and taskkill to kill a running program.
> >
> > Hi
> >
> > Note that taskkill (and I would think tskill also) does not
> > come with WinXP Home.
>
> I'm pretty sure tskill is in both HE and Pro while TaskKill is pro only.
At
> least that's how I remember it. I only used HE for about a week during the
> beta.
>
> I do wish there was a list of diffs. someplace though...
>
>

Tech TV has a decent article, with a chart. It doesn't include a list of
commands, which is probably what you're asking about, but it's kind of handy
nevertheless.

http://www.techtv.com/screensavers/windowstips/story/0,24330,3354933,00.html

The chart:

http://www.techtv.com/screensavers/windowstips/jump/0,24331,3355451,00.html

Mike Brown - Process Manager
03-04-2004, 07:02 PM
<xpert@mailshell13.mailshell.com> wrote in message
news:ugaq85aAEHA.212@TK2MSFTNGP12.phx.gbl...
> "Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
> news:40463825.3B40049C@hydro.com...
> > xpert@mailshell13.mailshell.com wrote:
> >
> >> "JT" <J.ct@gmx.net> wrote:
> >> > Hi, I need to close a program with the cmd on a win xp, dose someone
> >> > have an Idea
> >>
> >> XP includes tskill and taskkill to kill a running program.
> >
> > Hi
> >
> > Note that taskkill (and I would think tskill also) does not
> > come with WinXP Home.
>
> I'm pretty sure tskill is in both HE and Pro while TaskKill is pro only.
At
> least that's how I remember it. I only used HE for about a week during the
> beta.
>
> I do wish there was a list of diffs. someplace though...
>
>

Tech TV has a decent article, with a chart. It doesn't include a list of
commands, which is probably what you're asking about, but it's kind of handy
nevertheless.

http://www.techtv.com/screensavers/windowstips/story/0,24330,3354933,00.html

The chart:

http://www.techtv.com/screensavers/windowstips/jump/0,24331,3355451,00.html

Paul R. Sadowski
03-04-2004, 07:56 PM
"Mike Brown - Process Manager" <mikebNOSPAM@NOSPAMassetforwarding.comNOSPAM>
wrote in message news:k3L1c.8538$t16.5411729@newssvr28.news.prodigy.com...
>
> Tech TV has a decent article, with a chart. It doesn't include a list of
> commands, which is probably what you're asking about, but it's kind of
> handy
> nevertheless.
> http://www.techtv.com/screensavers/windowstips/story/0,24330,3354933,00.html
>
> The chart:
> http://www.techtv.com/screensavers/windowstips/jump/0,24331,3355451,00.html

Thanks!

Paul R. Sadowski
03-04-2004, 07:56 PM
"Mike Brown - Process Manager" <mikebNOSPAM@NOSPAMassetforwarding.comNOSPAM>
wrote in message news:k3L1c.8538$t16.5411729@newssvr28.news.prodigy.com...
>
> Tech TV has a decent article, with a chart. It doesn't include a list of
> commands, which is probably what you're asking about, but it's kind of
> handy
> nevertheless.
> http://www.techtv.com/screensavers/windowstips/story/0,24330,3354933,00.html
>
> The chart:
> http://www.techtv.com/screensavers/windowstips/jump/0,24331,3355451,00.html

Thanks!

Clay Calvert
03-05-2004, 12:45 AM
On Thu, 04 Mar 2004 19:02:40 GMT, "Mike Brown - Process Manager"
<mikebNOSPAM@NOSPAMassetforwarding.comNOSPAM> wrote:

>>> >> XP includes tskill and taskkill to kill a running program.
>> >
>> > Hi
>> >
>> > Note that taskkill (and I would think tskill also) does not
>> > come with WinXP Home.
>>
>> I'm pretty sure tskill is in both HE and Pro while TaskKill is pro only.
>At
>> least that's how I remember it. I only used HE for about a week during the
>> beta.
>>
>> I do wish there was a list of diffs. someplace though...
>>
>>
>
>Tech TV has a decent article, with a chart. It doesn't include a list of
>commands, which is probably what you're asking about, but it's kind of handy
>nevertheless.
>
>http://www.techtv.com/screensavers/windowstips/story/0,24330,3354933,00.html
>
>The chart:
>
>http://www.techtv.com/screensavers/windowstips/jump/0,24331,3355451,00.html

Hmmm. Note the chart isn't 100% accurate. I use Fast User switching
all the time on my XP Pro machines.

Clay Calvert
CCalvert@Wanguru.com
Replace "W" with "L"

Clay Calvert
03-05-2004, 12:45 AM
On Thu, 04 Mar 2004 19:02:40 GMT, "Mike Brown - Process Manager"
<mikebNOSPAM@NOSPAMassetforwarding.comNOSPAM> wrote:

>>> >> XP includes tskill and taskkill to kill a running program.
>> >
>> > Hi
>> >
>> > Note that taskkill (and I would think tskill also) does not
>> > come with WinXP Home.
>>
>> I'm pretty sure tskill is in both HE and Pro while TaskKill is pro only.
>At
>> least that's how I remember it. I only used HE for about a week during the
>> beta.
>>
>> I do wish there was a list of diffs. someplace though...
>>
>>
>
>Tech TV has a decent article, with a chart. It doesn't include a list of
>commands, which is probably what you're asking about, but it's kind of handy
>nevertheless.
>
>http://www.techtv.com/screensavers/windowstips/story/0,24330,3354933,00.html
>
>The chart:
>
>http://www.techtv.com/screensavers/windowstips/jump/0,24331,3355451,00.html

Hmmm. Note the chart isn't 100% accurate. I use Fast User switching
all the time on my XP Pro machines.

Clay Calvert
CCalvert@Wanguru.com
Replace "W" with "L"