Question
How does a Windows service differ from a standard exe?
What's the difference between a Windows service and a standard exe?
45 27170
45
Question
What's the difference between a Windows service and a standard exe?
Solution
A windows service always runs once the computer starts up (as long as it's so configured). A standard EXE only runs when a user is logged in, and will stop if the user logs out.
You would use a windows service for things that always need to run even if nobody is logged in.
You would use a standard EXE for programs that a user will run while logged in.
Solution
A Windows service has a special ServiceMain
function and must respond to Service Control Manager (SCM) commands properly in order to be functional as a service. On the other hand, a regular executable has a main
or WinMain
function and doesn't need to respond to any particular control commands.