Job Savers NT Service AppWizard | CodeGuru

Job Savers NT Service AppWizard

I wrote this wizard, not so much because NT Services are hard to write, but simply because they can be hard to debug if something is slightly wrong, so I figured I’d get the code right, and then automate it. Instruction This NT Service wizard is pretty simple to use, you only have to privide: […]

Written By
CodeGuru Staff
CodeGuru Staff
Oct 31, 1998
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

I wrote this wizard, not so much because NT Services are hard to write, but simply
because they can be hard to debug if something is slightly wrong, so I figured I’d get
the code right, and then automate it.

Instruction

This NT Service wizard is pretty simple to use, you only have to privide:


  • Internal name – Which should be unique, and not include spaces.
  • Display name – The string that you see in the list of the services manager.
  • Comments – You have to decide what level of source code comments you want.

Generated Code

The first thing you will want to do is build your new service, once thats done you can install it by typing:


  • myservice.exe install

Then later on you can remove it with:




  • myservice.exe remove me

The first thing everyone asks me when writting a new service is

What do I do now?

well, once you have your


service code, you will add a thread to do the real work you want done, I normally


create my threat in the bottom of serviceMain, and then put code in serviceHandler so that


my thread gets started/stopped/paused on all the service control notifications.

Install/Uninstall

To install any wizard, you must simply copy the wizard (any .awx file) it to your devstudio/sharedide/template directory.


Conversly, to remove a wizard, simply deleting the .awx file from your template directory while DevStudio isnt running
will do it.


Advertisement

Known Problems

You will see (and can ignore) the following warnings when compiling this code:


  • Command line warning D4024 : unrecognized source file type ‘d’, object file assumed
  • Command line warning D4027 : source file ‘d’ ignored

Download NT Service AppWizard – 12.9KB

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.