How to uninstall NT Service

J

Jin

Hello..

I installed two NT services:
1, servicename: service1; it runs c:\test\myservice.exe without
dependency
hService = ::CreateService(hSCM,
m_szServiceName,
m_szServiceName,
SERVICE_ALL_ACCESS,
SERVICE_WIN32_OWN_PROCESS,
SERVICE_DEMAND_START, // start condition
SERVICE_ERROR_NORMAL,
szFilePath,
NULL,
NULL,
NULL,
NULL,
NULL);
2, servicename: service2; it runs c:\test\myservice.exe depending on
MSSQLSERVER
hService = ::CreateService(hSCM,
m_szServiceName,
m_szServiceName,
SERVICE_ALL_ACCESS,
SERVICE_WIN32_OWN_PROCESS,
SERVICE_DEMAND_START, // start condition
SERVICE_ERROR_NORMAL,
szFilePath,
NULL,
NULL,
"MSSQLSERVER\0"
NULL,
NULL);

I made a mistake that I installed the service2 before uninstalling
service1. Before I installed service2, I can install/uninstall
service1 successfully. After I installed the service2, I could not
delete the service1(my code calls DeleteService(hService)).

Is there any way I can delete the service1, like modifying the
register file?

Thank u

Best Jin
 
V

Victor Bazarov

Jin said:
I installed two NT services:
[...]

I made a mistake [...]

Is there any way I can delete the service1, like modifying the
register file?

Please ask in a newsgroup dedicated to your OS. Your question has
absolutely NOTHING to do with C++ _language_, the _only_ topic of
this newsgroup. I suggest comp.os.ms-windows.programmer.win32.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
474,159
Messages
2,570,879
Members
47,414
Latest member
GayleWedel

Latest Threads

Top