Help and Support

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

Article ID:320052
Last Review:November 1, 2006
Revision:3.1
This article was previously published under Q320052
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.

Back to the top

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.

Back to the top

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

Back to the top

REFERENCES

For more information about the query process and tskill commands, visit the following Microsoft Web site:
Microsoft Windows 2000 Server Documentation (http://www.microsoft.com/windows2000/en/server/help/ts_cmd_n_001.htm )
For more information about Windows 2000 Terminal Services, visit the following Microsoft Web site:
Terminal Services Online Documentation (http://www.microsoft.com/windows2000/en/server/help/default.asp?url=/windows2000/en/server/help/sag_termsrv_topnode.htm)

Back to the top


APPLIES TO
Microsoft Windows 2000 Server
Microsoft Windows 2000 Advanced Server

Back to the top

Keywords: 
kbhowto kbhowtomaster KB320052

Back to the top

Article Translations

 

Related Support Centers

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.