NT Service App Wizard | CodeGuru

NT Service App Wizard

This NT service app wizard is based on the CNTService class. It simply adds a framework to this class and sets up your project. You only need to fill out some method bodies (have a look for those TODO: comments lurking around). You’re newly created service accepts the following command line switches: -i   Install […]

Written By
CodeGuru Staff
CodeGuru Staff
Feb 5, 1999
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

This NT service app wizard is based on the CNTService class. It simply adds a framework to this class and sets up your
project. You only need to fill out some method bodies (have a look for those TODO: comments lurking around).
You’re newly created service accepts the following command line switches:

-i

 

Install the service. After you’ve called your service with this switch, it should exist in Services
control panel applet.

 

-l account

The service shall run under the given account. This option is only useful with -i together. An
account name must consist of a domainname and a username separated by a backslash. The
domain . (dot) is predefined and addresses the local computer. A correct account name looks
like this: EuroS2Team\jko or even .\jko

 

-p password

The password for the account of the -l flag above. There is a security hazard here, because the
password is given in plain text. If this is a problem, you might use the control panel applet to set
the account/password.

-u

 

Uninstall the service. If the service is currently running, then stop it first.

-s

 

Start the service. The service must be installed before you can start it. Note that you cannot use
-i and -s together, instead you have to do it in 2 steps: 1. install, 2. start the service

-e

 

End a currently running service.

-d

 

Debug the service. This starts the service as a console application for easier debugging. You can
simulate a stop-request by pressing either Ctrl-C or Ctrl-Break.

-f

 

Start service as a faceless application (Win95/98 mode). This flag is implicitly set under
Win95/98. You have to turn your project into a windows application if you want to use this
switch under NT (but it’s better to use a real service under NT :-).

 

Note that this is a Visual C++ 6 Project. If you want to use the wizard for VC 5, you have to build a VC 5 project. The
source itself should be compatible (but I’ve not tested this).

Download wizard – 65 KB (copy the content of this file to <VisualStudioInstallDir>\Common\MSDev98\Template)

Download source – 133 KB

Date Last Updated: February 5, 1999

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.