Re: Windows-Dienst entfernen



Hallo Niels!

ich versuche einen Windows-Dienst zu deinstallieren, und habe das Problem, dass ich nachdem ich den Dienst gestoppt und mit 'DeleteService' entfernt habe, nicht unmittelbar die EXE-Datei löschen kann, sondern 'Zugriff verweigert' als Fehlermeldung bekomme.

Hast Du die Anmerkung in DeleteService aufmerksam gelesen:
The DeleteService function marks a service for deletion from the service control manager database. The database entry is not removed until all open handles to the service have been closed by calls to the CloseServiceHandle function, and the service is not running. A running service is stopped by a call to the ControlService function with the SERVICE_CONTROL_STOP control code. If the service cannot be stopped, the database entry is removed when the system is restarted.



--
Martin Richter [MVP] WWJD http://blog.m-ri.de
"A well-written program is its own heaven; a poorly written
program is its own hell!" The Tao of Programming
FAQ: http://www.mpdvc.de Samples: http://www.codeproject.com
.