Is there a way to view and/or kill a process from the command line of a windows machine?
Printable View
Is there a way to view and/or kill a process from the command line of a windows machine?
Will Stop A ProcessQuote:
command prompt>> NET STOP <service>
Will give you a list of processesQuote:
Command>> NET START
NET STOP will only work on installed services. to kill any process use (from systernals.com) the pstoolkit:
pslist -t will list running processes
pskill will kill them even when task manager will not.
to get an absolute complete list with info on all provesses:
psservice.exe
will give you:
SERVICE_NAME: AppMgmt
DISPLAY_NAME: Application Management
Provides software installation services such as Assign, Publish, and Remove.
TYPE : 20 WIN32_SHARE_PROCESS
STATE : 1 STOPPED
(NOT_STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 1077 (0x435)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
SERVICE_NAME: lanmanworkstation
DISPLAY_NAME: Workstation
Provides network connections and communications.
TYPE : 20 WIN32_SHARE_PROCESS
STATE : 4 RUNNING
(STOPPABLE,PAUSABLE,ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
etc.
these also work on machines remotly if you have admin rights to them
psservice \\mach_name start tlntsvr
Props to Tedob1 for the post on the SysInternals utils - they make some of the best utilities.
Another option would be to use the Windows Resource Kit Utility called "kill.exe".
Also from the resource kit utils. All of which can perform against remote machines...
* List of processes: PULIST
* List of services: SCLIST
* Stopping/Starting/Querying services: NETSVC
Oh, by the way, all of these are found in the NT 4.0 and W2K Resource Kits. And you can run the 4.0 utils on W2K with no probs.
Enjoy.
In Windows XP Pro, tasklist; taskkill.
taskkill is the best way if an offending service or program wil not let you load windows.
something like taskkill /f /pid will forcefully kill the service or program.
taskkill /f is something like kill -9 in unix.
If you are killing a process on a remote machine use /s to specify the correct remote system.
Thanks for all the great info