Sysinternals/Pstools/pskill

From aldeid
Jump to navigation Jump to search
You are here:
PsKill

Description

PsKill is part of the PsTools toolkit developed by Sysinternals. Terminates processes on local or remote systems.

Installation

PsKill is part of the PsTools suite. To install it, please refer to this section.

Usage

Syntax

Usage: pskill [-t] [\\computer [-u username [-p password]]] <process ID | name>

Options

-t
Kill the process and its descendants.
-u
Specifies optional user name for login to remote computer.
-p
Specifies optional password for user name. If you omit this you will be prompted to enter a hidden password.

Example

In a first window, using PsExec, we start by creating a new process on the remote target (say calc.exe):

C:\pstools>psexec \\192.168.1.27 -u pilou -p oopsoops "c:\windows\system32\calc.exe" 

In a second window, we check that the process has been started using pslist:

C:\pstools>pslist \\192.168.1.27 -u pilou -p oopsoops | find "calc" 
calc               3656   8   1   29    832     0:00:00.046     0:00:03.956

Now, we use pskill to kill the process:

C:\pstools>pskill \\192.168.1.27 -u pilou -p oopsoops 3656

PsKill v1.15 - Terminates processes on local or remote systems
Copyright (C) 1999-2012  Mark Russinovich
Sysinternals - www.sysinternals.com

Process 3656 on 192.168.1.27 killed....

The first window where psexec had been initialized shows following message, indicating that the process has been killed:

c:\windows\system32\calc.exe exited on 192.168.1.27 with error code 1.

Comments