Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2005

Tip: Looking for answers? Try searching our database.

Changing NT-Style Services and the Registry

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Itomeshi - 03 Mar 2005 19:38 GMT
I'm currently writing a simple, unmanaged, VC++ 2003 unmanaged app
without .NET libraries (for project specific reasons).

My current stumbling block is how to delete a service. The only method
I know of by hand is to go into the registry, navigate to
HKLM/System/CurrentControlSet/Services, and then look for the offending
virus that registers itself as the service "Network Client" with an
executable nwclnt.exe in the system32 directory. It is under a "nwclnt"
key. After this step, I can successfully delete the executable and
finish repairing Windows Update.

Is there any easier way to kill a service? I need to stop it and then
delete those keys. Any other method?

If not, what's the easiest method to check the registry for that and
eliminate it if it exists? I've toyed with the idea of outputting a
.reg file and running that through the shell command, but I'd like to
avoid that and do this through native / API code.

Example code would be preferred - I'm pretty new to C++, so any
information is helpful.

Thanks in advance,
Shawn McNaughton

P.S. If someone submits a more direct method to kill the service, help
with the registry access code is still appriciated - I will be using it
for other parts of this project.


Ronald Laeremans [MSFT] - 03 Mar 2005 19:54 GMT
> I'm currently writing a simple, unmanaged, VC++ 2003 unmanaged app
> without .NET libraries (for project specific reasons).
[quoted text clipped - 9 lines]
> Is there any easier way to kill a service? I need to stop it and then
> delete those keys. Any other method?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/se
rvice_functions.asp


is the entry point to the documentation of the list of functions you
need. There is also sample code to be found in some of the topics
refererenced from there.

Ronald Laeremans
Visual C++ team

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.