(SC) DeleteService FAILED 1072

Last time I create WAS profile and WASService then I try to config and run many script for learn how to config WAS, Finally it crash so i use wasprofile delete this profile and forgot delete WASService.

Now I found IBM Webphere Application Server service display in services.msc list, so I tried to delete it with WASService.exe -remove command and windows SC command but I got message

C:\Program Files\IBM\WebSphere\AppServer\bin>sc delete "IBMWAS61Service - DEV"
[SC] DeleteService FAILED 1072:
The specified service has been marked for deletion.

make sure the service is stopped, the services control panel is closed, and no open file handles are open by the service.

Also make sure ProcessExplorer is not running.


I had a similar problem and what I did to overcome it was the following:

  1. Stop the service: net stop "ServiceName"
  2. Ensure: the "mmc.exe" process does not exist (The "Services" list window): taskkill /F /IM mmc.exe
  3. Delete the service: sc delete "ServiceName"

    C:\server>sc delete "ServiceName"
    
    [SC] DeleteService SUCCESS
    

Now, if I execute another sc command, what I get is the following:

C:\server>sc delete "ServiceName"

[SC] OpenService FAILED 1060:

The specified service does not exist as an installed service.

But not the 1072 error message


What I've done is go to this location in regedit:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

From here, you will see a folder for every service on your machine. Simply delete the folder for the service you wish, and you're done.

N.B: Stop the service before you try this.