I have a Windows Server 2008 64 bit machine, and there is one program that is set to run on startup (shortcut placed in the Startup folder). So whenever a user logs in, the application starts up.
However, since this is a server, we have several users logging in via remote desktop, and (I believe) the application is started up for each user, resulting in multiple instances.
Now each time the application runs, it downloads some data from an external buffer via the LAN. These are call records for our telephone system. But because we have multiple instances running at the same time is causing problems and inconsistencies with the data.
Is there a way to force the Windows to run only one instance of the application? Alternatively, could this application be made to run as a Windows Service instead?
You have a program in the Startup folder and you would prefer to run it as a service? Create a service using NSSM and take it out of the Startup folder.
Note that if someone needed to use this program interactively, she would need to stop the service and run the program normally. Upon finishing the interactive session, she would need to close the program and then start the service.
Windows has no native feature to do what you ask.
Options: - run app as a service, if it has no gui - move app out of startup folder - move app to startup folder of a specific user who will only log in with one concurrent session - write a script, as a cmd or ps script, that 'does the right thing' (eg checks if app has run lately, or is running, etc)
I found free app for Windows 10 which doing that It's called SingleInstance. More details you can find in article: https://www.addictivetips.com/windows-tips/disable-multiple-instances-of-an-app-on-windows-10/
Credits to: https://www.dcmembers.com/skrommel/download/singleinstance/