# How do I limit the instances run on a computer

**URL:** <https://forum.inductiveautomation.com/t/how-do-i-limit-the-instances-run-on-a-computer/10368>\
**Category:** Ignition\
**Created:** [August 19, 2015, 3:13pm UTC](https://forum.inductiveautomation.com/t/how-do-i-limit-the-instances-run-on-a-computer/10368 "2015-08-19T15:13:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DarkFox](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@DarkFox](https://forum.inductiveautomation.com/u/DarkFox)\
**Post date:** [August 19, 2015, 3:13pm UTC](https://forum.inductiveautomation.com/t/how-do-i-limit-the-instances-run-on-a-computer/10368/1 "2015-08-19T15:13:42Z")

</div>

I am wondering how to limit the number of instances that can be opened on a computer? I am asking because we had a computer that someone had opened 5 instances of the same project. This can cause some large problems for us in data collection. I have not noticed a setting for this type of thing while programming. So I was wondering if anyone had any information or ways of doing this? Maybe a startup script or something?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 19, 2015, 3:38pm UTC](https://forum.inductiveautomation.com/t/how-do-i-limit-the-instances-run-on-a-computer/10368/2 "2015-08-19T15:38:10Z")

</div>

Yes, use [system.util.getSessionInfo()](https://support.inductiveautomation.com/usermanuals/ignition/system_util_getsessioninfo.htm) in a startup script. Loop through the dataset looking for IP addresses that match this client, and if they have a different clientID, you know there’s another instance running on that computer.  
At that point, you can open a warning window, and use [system.util.invokeLater()](https://support.inductiveautomation.com/usermanuals/ignition/system_util_invokelater.htm) to call [system.util.exit()](https://support.inductiveautomation.com/usermanuals/ignition/system_util_exit.htm) after a suitable delay.  
Also, you could set your application’s main window to not open automatically – open it from the startup script after verifying that the client is alone on that machine.

---

<div class="post-metadata">

**Author:** ![Duffanator](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/duffanator/32/3560_2.png) [@Duffanator](https://forum.inductiveautomation.com/u/Duffanator)\
**Post date:** [August 19, 2015, 7:41pm UTC](https://forum.inductiveautomation.com/t/how-do-i-limit-the-instances-run-on-a-computer/10368/3 "2015-08-19T19:41:34Z")

</div>

Put this script in your client start up script area. Modify as needed.

[code]# Check to see if there is already an Ignition client open on this PC. Trying to cut down on multiple clients open on one machine.  
projName = system.util.getProjectName()  
hostName = system.tag.read("[System]Client/Network/Hostname").value  
sessionInfo = system.util.getSessionInfo()

rowIndex = 0  
clientCount = 0  
for row in sessionInfo:  
if sessionInfo[rowIndex][1] == projName and sessionInfo[rowIndex][2] == hostName:  
clientCount += 1  
if clientCount \> 1:  
if system.gui.confirm(“There is already a client open on this PC, do you want to close this client?”, “Client Already Running”):  
system.util.exit()  
break  
rowIndex += 1[/code]
