Skip to content
Fix Code Error

How do I uninstall a Windows service if the files do not exist anymore?

March 13, 2021 by Code Error
Posted By: Thomas Jespersen

How do I uninstall a .NET Windows Service, if the service files does not exists anymore?

I installed a .NET Windows Service using InstallUtil. I have since deleted the files but forgot to run

 InstallUtil /u

first. So the service is still listed in the Services MMC.

Do I have to go into the registry? Or is there a better way?

Solution

You have at least three options. I have presented them in order of usage preference.

Method 1 – You can use the SC tool (Sc.exe) included in the Resource Kit.
(included with Windows 7/8)

Open a Command Prompt and enter

sc delete <service-name>

Tool help snippet follows:

DESCRIPTION:
        SC is a command line program used for communicating with the
        NT Service Controller and services.

delete----------Deletes a service (from the registry).

Method 2 – use delserv

Download and use delserv command line utility. This is a legacy tool developed for Windows 2000. In current Window XP boxes this was superseded by sc described in method 1.

Method 3 – manually delete registry entries (Note that this backfires in Windows 7/8)

Windows services are registered under the following registry key.

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServices

Search for the sub-key with the service name under referred key and delete it. (and you might need to restart to remove completely the service from the Services list)

Answered By: smink

Related Articles

  • Unexpected end of JSON input while parsing
  • How can I find the product GUID of an installed MSI setup?
  • Problems Installing CRA & NextJS from NPM…
  • Detect if Visual C++ Redistributable for Visual…
  • AppCompat v7 r21 returning error in values.xml?
  • Node.js Error: Cannot find module express
  • Error Message : Cannot find or open the PDB file
  • How to prevent scrolling the whole page?
  • How to make a SIMPLE C++ Makefile
  • What are the new features in C++17?
  • Running Python on Windows for Node.js dependencies
  • Eclipse will not start and I haven't changed anything
  • Simplest way to create Unix-like continuous pipeline…
  • How to update Python?
  • Apache server keeps crashing, "caught SIGTERM,…
  • How to completely uninstall Visual Studio 2010?
  • Convert bytes to a string
  • How do I include certain conditions in SQL Count
  • How to avoid a System.Runtime.InteropServices.COMException?
  • XAMPP Port 80 in use by "Unable to open process" with PID 4
  • center 3 items on 2 lines
  • How to get the system uptime in Windows?
  • How to uninstall a package installed with pip install --user
  • How to solve "The specified service has been marked…
  • OpenIddict Roles/Policy returns 403 Forbidden
  • Masked variables when overriding service commands are empty
  • Three.js: Cannot display mesh created with texture array
  • Resolving instances with ASP.NET Core DI from within…
  • How do I detect what .NET Framework versions and…
  • SignInManager.SignInAsync doesn't sign me in (Vue.js SPA)
  • How to download Xcode DMG or XIP file?
  • What are the undocumented features and limitations…
  • modal View controllers - how to display and dismiss
  • Use of Jquery on scroll event
  • Use JWT token in multiple projects
  • How to give ASP.NET access to a private key in a…
  • foreach loop in angularjs
  • How to read through or navigate through a json object?
  • How do I resolve `The following packages have unmet…
  • v-if not triggered on computed property
  • npm global path prefix
  • Pass data object from parent to child component
  • Ember Data Beta 2 FixtureAdapter Errors
  • Compiling a java program into an executable
  • How to avoid the "Circular view path" exception with…
  • Polymer 1.0 Trying to make a splitter which works…
  • Can't find file executable in your configured search…
  • Combine "terminal pattern rule" with "static pattern rule"
  • How to force uninstallation of windows service
  • Module name different from its Image File name
  • What is the JSF resource library for and how should…
  • How do SO_REUSEADDR and SO_REUSEPORT differ?
  • How do I install Java on Mac OSX allowing version switching?
  • Start / Stop a Windows Service from a…
  • Use latest version of Internet Explorer in the…
  • Logging best practices
  • I want to create a SQLite database like in the…
  • How can I convert my Java program to an .exe file?
  • Migrating program code written in C++ to C# - What's…
  • show dbs gives "Not Authorized to execute command" error
  • Detecting installed programs via registry
  • google-services.json for different productFlavors
  • Vue&TypeScript: how to avoid error TS2345 when…
  • Install Windows Service created in Visual Studio
  • Android Studio: Unable to start the daemon process
  • Smart way to truncate long strings
  • Detect whether Office is 32bit or 64bit via the registry
  • Backbone Relational not setting reverse relations properly?
  • Cannot access a disposed object. Object name:…
  • My local server can't find bower files when I run my…
  • npm behind a proxy fails with status 403
  • Unable to open debugger port in IntelliJ
  • How to uninstall a Windows Service when there is no…
  • Error message "Forbidden You don't have permission…
  • Start redis-server with config file
  • What does a "Cannot find symbol" or "Cannot resolve…
  • '' is not recognized as an internal or external…
  • The difference between the 'Local System' account…
  • System.BadImageFormatException: Could not load file…
  • Arrow flip when dropdown opens JS
  • How do I install SciPy on 64 bit Windows?
  • "message failed to fetch from registry" while trying…
  • Ember data parent / child models and json
  • JPA Hibernate Persistence exception…
  • AddTransient, AddScoped and AddSingleton Services…
  • How can I extract embedded fonts from a PDF as valid…
  • Is it possible to get ConnectionString from static…
  • Proper use of the IDisposable interface
  • Memcached vs. Redis?
  • Install a .NET windows service without InstallUtil.exe
  • What is the reason for the error message "System…
  • How do I get the SharedPreferences from a…
  • Compiling/Executing a C# Source File in Command Prompt
  • Check synchronously if file/directory exists in Node.js
  • Docker error cannot delete docker container,…
  • How to detect installed version of MS-Office?
  • Setting up and using Meld as your git difftool and mergetool
  • Ways to save Backbone.js model data?
  • Shuffle positions of options in flutter
  • SecurityException: Permission denied (missing…

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Post navigation

Previous Post:

HTML form readonly SELECT tag/input

Next Post:

How to declare variable and use it in the same Oracle SQL script?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

.net ajax android angular arrays aurelia backbone.js bash c++ css dataframe ember-data ember.js excel git html ios java javascript jquery json laravel linux list mysql next.js node.js pandas php polymer polymer-1.0 python python-3.x r reactjs regex sql sql-server string svelte typescript vue-component vue.js vuejs2 vuetify.js

  • you shouldn’t need to use z-index
  • No column in target database, but getting “The schema update is terminating because data loss might occur”
  • Angular – expected call-signature: ‘changePassword’ to have a typedeftslint(typedef)
  • trying to implement NativeAdFactory imports deprecated method by default in flutter java project
  • What should I use to get an attribute out of my foreign table in Laravel?
© 2022 Fix Code Error