TECH / Windows 2 min read

How to Stop or Force-Kill a Windows Service from Command Prompt (sc, net stop, taskkill)

Antonio NEMCD Author
Published Nov 9, 2016 · 2 min

Stopping a Windows service once is easy in Task Manager or services.msc. When a buggy service keeps hanging (like Windows Image Acquisition stisvc on scanner setups) and you want to kill or restart it on a schedule or with a single desktop click, the command line is much faster.

Stopping and force-killing Windows services from Command Prompt

Quick answer: stop a service normally with net stop stisvc or sc stop stisvc in an elevated Command Prompt. If the service is stuck in “Stopping” and ignores net stop, look up its PID via sc queryex and terminate it with taskkill /F /PID.

Method 1. Normal Service Stop (cmd & PowerShell)

Always try the clean stop commands first (run your console as Administrator):

net stop stisvc
# or via sc:
sc stop stisvc
# or in PowerShell:
Stop-Service -Name stisvc -Force

Here stisvc is the internal service name (find it by double-clicking any service in services.msc and checking the Service name field).

Method 2. Force-Kill a Hung Service (.bat Script)

Sometimes a service locks up in the Stopping state – buttons in services.msc turn gray and net stop hangs indefinitely. In that case, query the service’s process ID (PID) and force-kill it:

sc queryex stisvc
taskkill /F /PID 1234

To automate this in a reusable .bat script (for Task Scheduler or a one-click desktop fix), use this snippet – it finds the PID automatically on both English and localized Windows 10/11 builds:


Run the batch file as Administrator. I also keep the original archive hosted here: <a href="https://nemcd.com/wp-content/uploads/2016/11/kill-service.zip" target="_blank">download kill-service.zip</a>.

<a href="https://nemcd.com/wp-content/uploads/2016/11/service-stisvc.png"><img src="https://nemcd.com/wp-content/uploads/2016/11/service-stisvc-600x297.png" alt="Force killing the stisvc Windows service with taskkill" width="580" height="287" class="aligncenter size-medium wp-image-9363" /></a>

<strong>Heads-up:</strong> if a service shares a single <code>svchost.exe</code> process with other services, <code>taskkill /F</code> terminates all services inside that host process – double-check before force-killing core system services.

<h2>Killing a Regular App Process</h2>
If you just want to kill a frozen desktop app rather than a service, it is a single line using the executable name:

[bash gutter="false"]taskkill /F /IM "calc.exe"

Readers have confirmed this stisvc script saves them from rebooting Windows 10 whenever a scanner hangs – one double-click and you are back in business.

Related posts:

Leave a Comment