From the computer of: qmchenry The ability to perform tasks from a system's command line allows those tasks to be used in batch files. This recipe describes several uses of taskkill to terminate Windows processes. If you know the name of a process to kill, for example notepad.exe, use the following command from a command prompt to end it: taskkill /IM notepad.exe taskkill /PID 827 taskkill /F /FI "USERNAME eq Quinn" Filter Name Valid Operators Valid Value(s)
This will cause the program to terminate gracefully, asking for confirmation if there are unsaved changes. To forcefully kill the same process, add the /F option to the command line. Be careful with the /F option as it will terminate all matching processes without confirmation.
To kill a single instance of a process, specify its process id (PID). For example, if the desired process has a PID of 827, use the following command to kill it:
Using filters, a variety of different patterns can be used to specify the processes to kill. For example, the following filter syntax will forcefully kill all processes owned by the user Quinn:
The following table shows the available filters and their use.
----------- --------------- --------------
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.
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
eq: equals ne: not equal
gt: greater than lt: less than
gt: greater than or equal le: less than or equal
Friday, June 13, 2008
XP: kill a Windows process from the command line with taskkill
·
Subscribe to:
Post Comments (Atom)
Check out my new blog:
Translation
Recent Posts
Who's Online?
Pageviews Today
About Me
嗨,我是花,居住在印度兴奋的Windows,Linux中国的外籍人士和所有高科技的东西
Receive updates for free
Labels
- Tips 'n' Tricks (171)
- Windows Vista (105)
- Website/ Blogging (91)
- General (88)
- Windows XP (84)
- Internet (59)
- Windows 7 (54)
- Software (43)
- Mobile-Tips and Tricks (35)
- Review (28)
- Security (28)
- SEO Tools (25)
- iPhone (17)
- Linux (14)
- Windows Mobile (14)
- mac (13)
- Mobile (12)
- MS Office (7)
- Hardware (6)
- Windows 98 (6)
- Zune (6)
- Games (4)
- Mobile Reviews (3)
- Disclaimer (2)
Blog Archive
- June (2)
- May (2)
- August (2)
- July (1)
- June (1)
- May (2)
- April (4)
- March (4)
- February (1)
- December (2)
- November (1)
- November (1)
- June (2)
- May (28)
- April (54)
- March (83)
- February (60)
- January (57)
- December (48)
- November (17)
- October (28)
- September (22)
- August (19)
- July (34)
- June (59)
- May (1)
- April (5)
- March (22)
- February (5)
- January (31)
0 comments:
Post a Comment