Sometimes we all run into a service being stuck in a 'starting' or 'stopping' state. Using CMD you simply use below commands to kill the service.
1. Identify and get PID
sc queryex |more
Press <Enter>
Use space to move fast down to results (sorted by A-Z)
* If you know your reg name of the service the you can direclty run :
sc queryex servicename
Get the PID of the service!
2. Kill the service with taskkill command
taskkill /f /pid [PID]
Press <Enter>
This will force kill the service.
Extra Info:
1. Tasklist : Refer to Microsoft’s Help File
2. Taskkill : Similar to Tskill. Refer to Microsoft’s Help File.
* NOTE:
To view a process on a remote system:
tasklist.exe /S SYSTEM /U USERNAME /P PASSWORD
To kill a process on a remote system:
taskkill.exe/S SYSTEM /U USERNAME /P PASSWORD /IM PROCESS
ex. taskkill.exe /S PC1 /U SirX /P 123456 /IM iexplore.exe
taskkill.exe /S PC1 /U SirX /P 123456 /PID 1976 /F
No comments:
Post a Comment