Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Windows Tutorials»How to force kill a service on Windows

    How to force kill a service on Windows

    By RahulFebruary 22, 20232 Mins Read

    In Windows, sometimes a service may become unresponsive or stuck and not be stopped using the usual net stop or Task Manager methods. In such cases, you can force kill the service using the taskkill command. This tutorial will guide you through the process of force killing a service on Windows.

    Advertisement

    Problem:

    In our AWS windows server, the Amazon SSM Agent service was hung during the startup. The service status kept showing starting always.

    Hanged Service on Windows

    Now the only option available to forcefully kill this service by the process id on the Windows system. Below instructions will help you with it.

    Solution:

    • 1. Find the Service name – Right-click on the service and open properties. Here you will find the service name under the General tab. For example, view the below screenshot.

      Find Windows Service name

      In my case the service name is AmazonSSMAgent

    • 2. Find the PID – Then execute the below command with the service name identified above.
      sc queryex [servicename]
      

      This will show you the service details on the console as below.

      Find PID of Windows Service

    • 3. Kill Process by PID – Find out the service’s PID (process id) and force kill process by using the below command. Use pid number found with the previous command.
      taskkill /f /pid <PID>
      

      Replace with the actual Process ID of the service you want to force kill.

      Kill Process by PID on Windows

    • All done. You can now start your service now.

    Conclusion

    Force killing a service using the taskkill command is a quick and effective way to stop unresponsive or stuck services on Windows. However, it should be used as a last resort, as it can result in data loss or other issues if incorrectly used. Always save any important data before attempting to force kill a service, and use this method only if other methods have failed to stop the service.

    kill pid services windows
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    4 Methods to Check .NET Framework Version on Windows

    Generate the SSH Key Pair on Windows {5 Steps}

    How to Clear the ASP.NET Temporary files in Windows

    View 3 Comments

    3 Comments

    1. Lee H on November 8, 2021 7:45 am

      I once used task kill with the windows update service. Unfortunately, now I need to reopen it because a program needs window update security to open it after a long time. What should I do? Ty sir /madam

      Reply
    2. John on August 6, 2021 1:54 pm

      Thanks, unfortunately even with the ‘force’ parameter, it seems sometimes Windows refuses… ‘access is denied’

      Reply
      • Nitin sharna on August 12, 2021 7:28 am

        You need to run cmd as administrator

        Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Implementing a Linux Server Security Audit: Best Practices and Tools
    • cp Command in Linux (Copy Files Like a Pro)
    • 15 Practical Examples of dd Command in Linux
    • dd Command in Linux (Syntax, Options and Use Cases)
    • Iptables: Common Firewall Rules and Commands
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.