Windows Services and Multiple Registered Users

I am developing a Windows service that will run at a specific time every day. What happens if multiple users log in to this machine? Will it work 5 times at the same time if 5 users enter it? If so, is there a way to prevent this?

+3
source share
3 answers

The Windows service is installed throughout the machine and runs under one specified user account, which in fact cannot be a "user", but a "local system" or a "network service" or similar.

The service will work only once, regardless of the login. In fact, it will work if the computer is turned on, even if the user is not logged in.

+6
source

Windows services are started once for each machine.

The account under which the service runs can be specified in the Windows Services MMC. Typically, the service will run under the Local System account.

If you want your application to run only once on a computer, you are headed in the right direction using the service. However, if you want it to run on schedule, a simple application that runs the Windows Task Scheduler might be the best route.

+1
source

, , .

. Windows Service ? , , . , , - . , , , . , , .

, , , , - .

+1

Source: https://habr.com/ru/post/1751379/


All Articles