XP: kill a Windows process from the command lin...
2013-01-22 00:00
411 查看
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:
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.
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
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:
taskkill /PID 827
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:
taskkill /F /FI "USERNAME eq Quinn"
The following table shows the available filters and their use.
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. 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
相关文章推荐
- How to achieve the boot, clear cache, kill the process, floating windows single double-click to distinguish, with source
- How PowerShell Differs From the Windows Command Prompt
- Managing Windows Programs from the Command Line: Tasklist
- How can I hide a user from the Welcome Screen in Windows XP?
- How to start a Windows CE emulator from the command line
- The Method OF Kill Given Process In Guest OS From VMM
- Run an Oracle Xellerate Task Scheduler from the Command-Line
- VM8.0装win8出现的windows cannot read the product key setting from the unattend answer file
- Fix win10+vs2013: "Could not find WindowsSDKDir variable from the registry"
- Windows Administration at the Command Line
- Microsoft SQL Reporting Services – Running a Report from the Command Line
- Unable to Drop a Datafile From the Tablespace Using Alter Tablespace Command (Doc ID 1050261.1)
- [RT] Twitter from the command line in python using OAuth
- Images of Ireland Desktop Theme for Windows XP
- Java How to get the PID from a process?
- how to check port number and kill process with the port number
- Common way to kill the Excel process
- Windows Administration at the Command Line for Windows Vista, Windows 2003, Windows XP, and Windows
- How to extract msu/msp/msi/exe files from the command line
- MS SQL错误:SQL Server failed with error code 0xc0000000 to spawn a thread to process a new login or connection. Check the SQL Server error log and the Windows event logs for information about possible related problems