Sometimes when a windows service does not behave as expected, a restart of the service is required. This is easily done in the ‘Service’ window, by right clicking on a particular service and then left clicking on ‘Restart’. After doing this, usually the service will restart, but if the service is stuck at ‘Stopping’, a ‘taskkill’ command can be used to force stop the service.
In the example below, a Matrikon Tunneller CSC service is stuck at ‘Stopping’.
To ensure the taskkill command run successfully the command window will need to run as an administrator user. Right click on the Command Prompt icon and click on ‘Run as administrator’.
The taskkill command format is:
taskkill /pid <PID> /f
Where the <PID> is the process ID which is displayed in the ‘PID’ column in the task manager. The ‘/f’ parameter specifies to forcefully terminate the task/process. Enter the command as per the example below and then press enter.
A “SUCCESS” message will be displayed.
Verify in task manager of services window that the service has stopped.