HOW TO: Use the TSKILL Command to End Processes in Windows 2000 Terminal Services

Article translations Article translations
Article ID: 320052 - View products that this article applies to.
This article was previously published under Q320052
Expand all | Collapse all

On This Page

SUMMARY

This step-by-step article describes how to end active processes that are running on a Terminal Services server by using the tskill command.

You can end active processes that are running on a Terminal Services server by right-clicking the processes on the Processes tab in Terminal Services Manager, and then clicking End Process, or by using the tskill command. Note that if you end a process, no notification is sent to the user. The process is immediately ended.

Only administrators can use the tskill command to end processes that run in other user sessions. Unless you are logged on as Administrator or as a member of the Administrators group, you can use tskill to end only those processes that belong to you.

Description of the TSKILL Command

The tskill command has the following syntax:
tskill ProcessID | ProcessName [/server:ServerName] [/id:SessionID | /a] [/v]
The parameters for the tskill command are:
  • ProcessID: Use this parameter to specify the ID of the process that you want to end. To determine the ID of the process that you want to end, use the query process command.
  • ProcessName: Use this parameter to specify the name of the process that you want to end. To determine the name of the process that you want to end, use the query process command.
  • /server:ServerName: Use this parameter to specify the Terminal Services server that contains the process that you want to end. If you omit this parameter, the current Terminal Services server is specified.

    NOTE: If you use this parameter, you must also use either the /id:SessionID or the /a parameter.
  • /id:SessionID: Use this parameter to specify the ID of the session that contains the process that you want to end.
  • /a: Use this parameter to end all instances of the process that is running on the server.
  • /v: Use this parameter to display information about the actions that are performed when you run the command.
NOTE: When all processes that are running in a session end, the session also ends.

How to End Processes

To use the tskill command to end processes on a Terminal Services server:
  1. Click Start, and then click Run.
  2. Type cmd, and then click OK.
  3. Determine the name or ID of the process that you want to end. To do so, use the query process command.

    For example, to display a list of all users who are running the Myapp.exe process on the current Terminal Services server, type query process myapp.exe at the command prompt, and then press ENTER. You receive a list of all users who are running the Myapp.exe process. The list may be similar to this:
       USERNAME        SESSIONNAME     ID PID     IMAGE
       >administrator  console         0  1248    myapp.exe
        user1          rdp-tcp#1       1  1592    myapp.exe
        user2          rdp-tcp#2       2  1588    myapp.exe
    					
  4. To end the Myapp.exe process for User1 by using the process ID, type the following line at the command prompt, and then press ENTER:
    tskill 1592
    To end all instances of the Myapp.exe process that are running on the current Terminal Services server and to display information about the actions that are performed when you run the command, type the following line at the command prompt, and then press ENTER:
    tskill myapp /a /v
    To end the Myapp.exe process from a remote Terminal Services server for User2 by using the process name, type the following line at the command prompt, where Server8 is the name of the Terminal Services server that contains the Myapp.exe process that you want to end, and then press ENTER:
    tskill myapp /server:server8 /id:2

REFERENCES

For more information about the query process and tskill commands, visit the following Microsoft Web site:
Microsoft Windows 2000 Server Documentation

Properties

Article ID: 320052 - Last Review: November 1, 2006 - Revision: 3.2
APPLIES TO
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
Keywords: 
kbhowto kbhowtomaster KB320052

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com