close a program with cmd

  • Thread starter Thread starter JT
  • Start date Start date
JT said:
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) said:
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...
 
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
 
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
(e-mail address removed)
Replace "W" with "L"
 
Back
Top