Delete service ошибка 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.

AngocA's user avatar

AngocA

7,6556 gold badges39 silver badges56 bronze badges

asked Nov 20, 2008 at 11:44

Fuangwith S.'s user avatar

Fuangwith S.Fuangwith S.

5,6548 gold badges37 silver badges41 bronze badges

0

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.

Josh Petitt's user avatar

Josh Petitt

9,37112 gold badges56 silver badges104 bronze badges

answered Nov 20, 2008 at 12:02

StingyJack's user avatar

StingyJackStingyJack

19.1k10 gold badges64 silver badges122 bronze badges

6

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

Pacerier's user avatar

Pacerier

86.4k107 gold badges368 silver badges635 bronze badges

answered Aug 26, 2011 at 9:43

Tate's user avatar

5

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.

iCodeSometime's user avatar

answered May 10, 2010 at 15:49

Onion-Knight's user avatar

Onion-KnightOnion-Knight

3,4777 gold badges31 silver badges34 bronze badges

3

For some buggy reason both Event Viewer and/or Services.msc won’t do a proper refresh when you tell them to!

Close them and restart, and the service would have been deleted anyway.

answered Apr 24, 2018 at 6:30

Fandango68's user avatar

Fandango68Fandango68

4,5074 gold badges39 silver badges74 bronze badges

0

I had the same issue. After I closing and re-opening the Computer Management window the service was removed from the list. I’m running windows 7

answered Apr 5, 2012 at 17:48

Rob's user avatar

RobRob

1661 silver badge4 bronze badges

In Windows 7, make sure Event Viewer closed before deleting.

answered Aug 27, 2013 at 13:39

lsalamon's user avatar

lsalamonlsalamon

7,9986 gold badges50 silver badges63 bronze badges

I had this error also, make sure the exe the service is pointing to is stopped. Also make sure you don’t have any Windows dialog boxes behind your other windows. That is why mine wasn’t deleting. There was a windows message behind it saying this service has been deleted or something similar.. just had to click ok, there it went.

answered Mar 27, 2013 at 23:18

germs's user avatar

germsgerms

111 bronze badge

I had the same error due to a typo in the service name, i was trying to delete the service display name instead of the service name.
Once I used the right service name it worked fine

answered Feb 24, 2014 at 15:40

Rahamat's user avatar

Logging-out and logging-in again close all blocking apps thus resolves the problem.

answered Jan 8, 2016 at 19:17

vahapt's user avatar

vahaptvahapt

1,6951 gold badge21 silver badges26 bronze badges

The 3rd party application uninstaller had removed the files for the service and then left the service in this pending deletion state.

After trying to close all applications, identifing PID of service(couldn’t) for kill, logging off all other users and logging off and on, rebooting was the only fix that worked for me.

answered Jun 10, 2016 at 16:06

rob's user avatar

robrob

8,1438 gold badges58 silver badges68 bronze badges

One situation where this can also happen is if there is some other service or application that is holding open a service handle obtained with OpenService. For example, a monitoring service that starts and stops services based on some external event can keep open handles to each of the services it monitors. In this case, uninstalling the service would leave it in the «marked for deletion» state until all handles obtained with OpenService are closed.

answered Sep 22, 2022 at 10:39

jrbjazz's user avatar

jrbjazzjrbjazz

3,14022 silver badges19 bronze badges

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.

AngocA's user avatar

AngocA

7,6556 gold badges39 silver badges56 bronze badges

asked Nov 20, 2008 at 11:44

Fuangwith S.'s user avatar

Fuangwith S.Fuangwith S.

5,6548 gold badges37 silver badges41 bronze badges

0

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.

Josh Petitt's user avatar

Josh Petitt

9,37112 gold badges56 silver badges104 bronze badges

answered Nov 20, 2008 at 12:02

StingyJack's user avatar

StingyJackStingyJack

19.1k10 gold badges64 silver badges122 bronze badges

6

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

Pacerier's user avatar

Pacerier

86.4k107 gold badges368 silver badges635 bronze badges

answered Aug 26, 2011 at 9:43

Tate's user avatar

5

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.

iCodeSometime's user avatar

answered May 10, 2010 at 15:49

Onion-Knight's user avatar

Onion-KnightOnion-Knight

3,4777 gold badges31 silver badges34 bronze badges

3

For some buggy reason both Event Viewer and/or Services.msc won’t do a proper refresh when you tell them to!

Close them and restart, and the service would have been deleted anyway.

answered Apr 24, 2018 at 6:30

Fandango68's user avatar

Fandango68Fandango68

4,5074 gold badges39 silver badges74 bronze badges

0

I had the same issue. After I closing and re-opening the Computer Management window the service was removed from the list. I’m running windows 7

answered Apr 5, 2012 at 17:48

Rob's user avatar

RobRob

1661 silver badge4 bronze badges

In Windows 7, make sure Event Viewer closed before deleting.

answered Aug 27, 2013 at 13:39

lsalamon's user avatar

lsalamonlsalamon

7,9986 gold badges50 silver badges63 bronze badges

I had this error also, make sure the exe the service is pointing to is stopped. Also make sure you don’t have any Windows dialog boxes behind your other windows. That is why mine wasn’t deleting. There was a windows message behind it saying this service has been deleted or something similar.. just had to click ok, there it went.

answered Mar 27, 2013 at 23:18

germs's user avatar

germsgerms

111 bronze badge

I had the same error due to a typo in the service name, i was trying to delete the service display name instead of the service name.
Once I used the right service name it worked fine

answered Feb 24, 2014 at 15:40

Rahamat's user avatar

Logging-out and logging-in again close all blocking apps thus resolves the problem.

answered Jan 8, 2016 at 19:17

vahapt's user avatar

vahaptvahapt

1,6951 gold badge21 silver badges26 bronze badges

The 3rd party application uninstaller had removed the files for the service and then left the service in this pending deletion state.

After trying to close all applications, identifing PID of service(couldn’t) for kill, logging off all other users and logging off and on, rebooting was the only fix that worked for me.

answered Jun 10, 2016 at 16:06

rob's user avatar

robrob

8,1438 gold badges58 silver badges68 bronze badges

One situation where this can also happen is if there is some other service or application that is holding open a service handle obtained with OpenService. For example, a monitoring service that starts and stops services based on some external event can keep open handles to each of the services it monitors. In this case, uninstalling the service would leave it in the «marked for deletion» state until all handles obtained with OpenService are closed.

answered Sep 22, 2022 at 10:39

jrbjazz's user avatar

jrbjazzjrbjazz

3,14022 silver badges19 bronze badges

It seems that on Windows versions later than Windows 7 (unverified, but by experience latest with Windows Server 2012 R2), the Service Control Manager (SCM) is more strict.

While on Windows 7 it just spawns another process, it is now checking whether the service process is still around and may return ERROR_SERVICE_MARKED_FOR_DELETE (1072) for any subsequent call to CreateService/DeleteService even if the service appears to be stopped.

I am talking Windows API code here, but I want to clearly outline what’s happening, so this sequence may lead to mentioned error:

SC_HANDLE hScm = OpenSCManager(nullptr, nullptr, SC_MANAGER_ALL_ACCESS);

SC_HANDLE hSvc = OpenService(hScm, L"Stub service", SERVICE_STOP | SERVICE_QUERY_STATUS | DELETE);

SERVICE_STATUS ss;
ControlService(hSvc, SERVICE_CONTROL_STOP, &ss);
// ... wait for service to report its SERVICE_STOPPED state

DeleteService(hSvc);
CloseServiceHandle(hSvc);
hSvc = nullptr;

// any further calls to CreateService/DeleteService will fail
// if service process is still around

The reason a service process is still around after it already has reported its SERVICE_STOPPED state isn’t surprising. It’s a regular process, whose main thread is ‘stuck’ in its call to the StartServiceCtrlDispatcher API, so it first reacts to a stop control action, but then has to execute its remaining code sequence.

It’s kind of unfortunate the SCM/OS isn’t handling this properly for us.
A programmatic solution is kinda simple and accurate: obtain the service executable’s process handle before stopping the service, then wait for this handle to become signaled.

If approaching the issue from a system administration perspective the solution is also to wait for the service process to disappear completely.

Любая сторонняя или системная служба, если она не является критически важной, может быть остановлена в оснастке управления службами или в консоли командой Net Stop Name. А если служба не нужна, так ее можно и вовсе удалить, используя команду sc delete [имя службы]. Увы, далеко не всякую службу можно удалить таким способом и причем не во всех случаях. Так, при удалении службы вы можете получить сообщение об ошибке с кодом 1072 и комментарием «Указанная служба была отмечена для удаления».

Указанная служба была отмечена для удаления

Главная причина описанной выше ошибки — запущенный процесс службы или удержание ее родительским процессом приложения, эту службу установившую. Известны также случаи, когда удалению службы препятствовал процесс самой оснастки управления службами, хотя подобное кажется маловероятным. Поэтому, перед тем как удалять службу, убедитесь, что она находится в состоянии «Остановлена».

В противном случае остановите службу через оснастку services.msc.

Services

Или запущенную от имени командную строку командой net stop [имя службы], а затем принудительно завершите и ее процесс, выполнив тут же в командной строке команду taskkill /F /IM [имя процесса службы].

CMD

После этого повторите команду удаления службы.

Sc delete

В случае успешного удаления службы команда вернет строку «успех».

Кстати, если после успешного удаления службы выполнить команду sc delete [имя службы] еще раз, вы получите ошибку с кодом 1060 и сообщением «Указанная служба не установлена».

Указанная служба не установлена

Если служба не желает удаляться через командную строку, попробуйте удалить ее через редактор реестра, однако будьте очень осторожны, так как этим способом можно удалить даже системные службы, необходимые для корректной работы операционной системы и ее компонентов.

Записав или запомнив имя службы, откройте командой regedit редактор реестра, разверните ветку:

HKLM\SYSTEM\CurrentControlSet\Services

И отыщите в раскрывшемся списке каталог с именем службы, которую хотите удалить.

RegEdit

Удалите его со всем его содержимым и перезагрузите компьютер.

Удаление службы не приводит к удалению ее исполняемого файла, но всё равно будьте осторожны, чтобы ненароком не нарушить работу Windows, если захотите таким образом избавиться от ненужных, как это вам представляется, служб.

Загрузка…


Windows 10, Windows 7, Windows 8, Windows Server, Windows Vista, Windows XP

  • 21.08.2021
  • 11 241
  • 0
  • 22.08.2021
  • 7
  • 7
  • 0

Ошибка: 1072:  Указанная служба была отмечена для удаления

  • Содержание статьи
    • Описание проблемы
    • Решение проблемы
    • Добавить комментарий

Описание проблемы

При удалении службы из командной строки, с помощью команды sc delete [имя службы] можно столкнуться с ошибкой 1072:

[SC] DeleteService: ошибка: 1072:

Указанная служба была отмечена для удаления.

Решение проблемы

Как правило, такое сообщение появляется, когда было начато удаление службы, но по каким-то причинам, еще не было завершено до конца. Как правило, это возникает из-за следующих причин:

  • Процесс данной службы по прежнему запущен. Попробуйте завершить процесс через Диспетчер задач, или через командную строку, воспользовавшись следующими командами:
    net stop [ИМЯ СЛУЖБЫ]
    taskkill /F /IM [ИМЯ ПРОЦЕССА СЛУЖБЫ]

    После этого, пробуем вновь выполнить команду для удаления службы.

  • Как не странно, но запущенный список служб тоже блокирует удаление службы. Закройте окно со службами, так же на всякий случай можно закрыть вообще все окна с консолями управления Windows, завершив процессы mmc.exe через Диспетчер задач, или через комадную строку, выполнив следующую команду:
    taskkill /F /IM mmc.exe

    После этого, можно повторно выполнить команду для удаления службы.

В случае успешного удаления службы, команда для удаления службы будет возвращать уже совсем другую ошибку:

[SC] OpenService: ошибка: 1060:

Указанная служба не установлена.

Данная ошибка свидетельствует о том, что данной службы на компьютере нет.

Понравилась статья? Поделить с друзьями:
  • Delfis ctfs 24 ошибка e52
  • Deleted due to error konica minolta ошибка
  • Delete scalar ошибка c
  • Del ошибка на стиральной машине lg
  • Delem da 66t коды ошибок