Discussion Locked

making an application run as a service

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have an application that I need running on my NT 4.0 WS even if no one is logged into the computer. putting the app in the startup folder wont work because startup folder only executes after login. I tried going to control panel\network clicked add service, have disk and pointed it to my exe but it wanted an oemsetup.inf or oemsetnt.inf file. This application doesnt have one.

7 replies

by syscokid

You can use the Srvany.exe tool that comes with the Resoucre Kit to run an app as a service.

From the documentation:

You can use the Srvany utility to run Windows NT applications as services, with the following benefits.
 When applications are run as services, they are not closed during logoff, so users do not need to restart them each time they log on.
 Server applications can service requests even when no user is logged on.
 Applications can run and perform tasks specific to a logon account that is different from the user who is currently logged on.

by 1ronman

Thanks. My app would not run as a service , However your answer was the first to tell me how to do it with other apps.

by it

Here is a link to a utility I have used in the past to run an app as a service...
http://www.winwinsoft.com/goodies/RunExeSvc/
Additionally you can edit the registry following the advice from Microsoft for srvany (part of the NT Resource Kit).
Specifying the application to start & its parameters:

Run the Registry Editor (REGEDT32.EXE):
-> under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyService: create a 'Parameters' key
-> under the above key, create an 'Application' value of type REG_SZ and specify there the full path of your app executable (including the extension). For example:
Application: REG_SZ: D:\TOOLS\VI.EXE
-> OPTIONAL: under the above key, create an 'AppParameters' value of type REG_SZ and specify the parameters for your app. For Example:
AppParameters: REG_SZ: C:\TMP\FOO
-> OPTIONAL: under the above key, create an 'AppDirectory' value of type REG_SZ and specify the current directory to use for the app, eg:
AppDirectory: REG_SZ: C:\TMP

by cwaller

I would setup a routine with the at command you can specify a time to run and what to run. For an quick way down load winat.

This discussion is closed to new replies.