Many business applications, interfaces and utilities are written as ordinary programs: someone logs on to the server, starts them, and they run until that user logs off. In daily operation this is impractical. After every update reboot someone has to log on, an accidental logoff stops the interface, and an RDP session left open permanently is a security risk. As a Windows service, however, the program starts with the system, runs without a logged-on user and survives logoffs and reboots. There are several ways to get there.
sc.exe: only for real service programs
The obvious choice is sc.exe create. It registers any EXE as a service – but the service only starts if the program was actually written as one. The service control manager starts the process and expects the program to connect to it via the StartServiceCtrlDispatcher function and report the "running" status. An ordinary program never does this. Once the timeout expires – 30 seconds by default – you get the well-known error 1053, "The service did not respond to the start or control request in a timely fashion", and the start is aborted. Raising the timeout does not help: the program will not report back after five minutes either.
The classics: instsrv and srvany
For this problem, Microsoft used to describe two small Resource Kit tools: instsrv registers a service, and srvany acts as the service and starts the actual program, which you enter manually in the registry under Parameters\Application. The instructions date from the Windows NT era, the tools are not part of Windows and have to be taken from old Resource Kit packages. For new installations, that is no longer a good foundation.
Task Scheduler "At startup"
Task Scheduler works without additional software: a task with the "At startup" trigger runs as soon as the Task Scheduler service is up during boot, and with "Run whether user is logged on or not" no logon is required. For scripts that should run once at startup, this is ideal. For long-running programs there are catches: by default Task Scheduler stops a task after 72 hours (this can be turned off), the task runs in a non-interactive session, and it does not show up in the Services console, where colleagues would look for it.
Session 0 isolation: why windows stay invisible
Since Windows Vista, services run in session 0, which is reserved exclusively for services; logged-on users work in session 1, 2 and so on. According to Microsoft, services cannot display a user interface such as a dialog box directly. For GUI programs this means: the program runs, but nobody sees its windows. If the application asks for a license, reports an error or asks "Save changes?" when closing, it waits for a click that nobody can make. The old option "Allow service to interact with desktop" no longer helps: interactive services are blocked by default, and users do not work in session 0 anyway.
Service wrappers
A service wrapper sits between the service control manager and the program: it is a real service itself, starts the program and stops it again. Such wrappers exist as free and commercial tools. When choosing one, check how it handles GUI programs and dialogs, whether it stops programs gracefully, what happens to child processes and whether it is still maintained.
PriCoSoft SrvAny 2.2
SrvAny is our own wrapper, completely re-developed in version 2.2. It runs GUI and console programs as a service, with arguments, working directory and environment variables.
- Service Manager: create, change, start, stop and delete any number of services, set the start type and service account (including gMSA and virtual accounts), read the logs right in the program – no registry editor needed.
- Viewer: shows the program's windows and lets you operate them with mouse and keyboard, including dialogs and a text clipboard. For security reasons it works only locally on the server (for example in an RDP session) and only for administrators.
- Graceful stop: on stop and shutdown, first like a Windows logoff, then closing the windows, Ctrl+C, and only as the last step terminating the process tree.
- Job object: the program and its child processes never outlive the service, even if the host process is killed.
- Private desktop with restricted rights.
The limits: the Viewer sends input as window messages – programs that read mouse and keyboard directly (DirectX applications, for example) may not react to it. The private desktop has a fixed size, usually 1024 × 768. Some WinForms programs only show their main window in the interactive window station of session 0; this can be configured, but only with the Local System account. SrvAny runs on Windows Server 2016 to 2025 and Windows 10/11 (x64) with .NET Framework 4.7.2 and ships as a signed MSI.
Which approach fits?
- The program already is a real service:
sc.exeor the vendor's setup. - A script should run once at startup: Task Scheduler.
- An ordinary program should run permanently, possibly with windows and dialogs: a service wrapper such as SrvAny.
We are happy to check with you whether your application can run as a service and to set it up for you.


