Arvind Chourasiya
Arvind Chourasiya

Reputation: 17412

Windows service not getting uninstalled

I want to uninstall Windows Service from command prompt but that is not working getting below error

'installutil' is not recognized as an internal or external command, operable program or batch file.

This way I have tried command

D:\backup\WindowsService\WindowsService1\WindowsService1\obj\Debug>installutil -u TestService.exe

D:\backup\WindowsService\WindowsService1\WindowsService1\obj\Debug>installutil -u "TestService.exe"

How can I uninstall service?

Upvotes: 1

Views: 269

Answers (1)

Ali1928
Ali1928

Reputation: 303

After your comment, your issue seems related to %PATH%.

There is no such thing as "installutil" on your Windows. I believe "installutil" has created by you right?

Let's assume that binary resides at C:\Myproject\installutil.exe

There are two ways to execute it.

First:

C:\users\username> cd C:\Myproject C:\Myproject> .\installutil.exe -u "bla bla bla bla".

Second:

Go to your start menu and search for "environment". Open "Edit the system variables" under "System properties". At the "Advanced" tab, you'll see "Environment Variables". You'll see a variable named "Path". Edit it's value and add your own .exe path at the end.

When you execute "echo %PATH" at command prompt, you should see your binary's folder. Otherwise, command prompt will not be able to find it.

EDIT:

So yeah, there is one such thing called installutil.exe and it can be used by the Developer Command Prompt for Visual Studio.

Command to uninstall service: installutil -u "AirwatchService.exe"

Are you sure you're using the right command prompt? Do you have the absolute path of this binary?

Please check this: https://learn.microsoft.com/en-us/dotnet/framework/tools/installutil-exe-installer-tool

Upvotes: 2

Related Questions