Another instance is running

broken image
broken image

See the examples for alternatives.ĮDIT 1: Just saw your comment that you have got a console application. While using your computer you may have come across Another instance is running error, which appears sometimes when you trying to open certain files, applications or games. Hitfilm itself will be stopped if clicked away quickly, but some background processes keep running, which is why it thinks that more instances are running. No other instance was found, return null. I have both express and pro next to eachother on the taskbar, so it happens sometimes that I click the wrong one. If (Assembly.GetExecutingAssembly().Location. Make sure that the process is running from the exe file. Loop through the running processes in with the same name Process processes = Process.GetProcessesByName (current.ProcessName) Process current = Process.GetCurrentProcess() Which will kill the currently loading process instantly. OR if ((System.IO.Path.GetFileNameWithoutExtension(().Location)).Count() > 1) ().Kill() This works for any application (any name) and will become true if there is another instance running of the same application.Įdit: To fix your needs you can use either of these: if ((System.IO.Path.GetFileNameWithoutExtension(().Location)).Count() > 1) return įrom your Main method to quit the method. var exists = (System.IO.Path.GetFileNameWithoutExtension(().Location)).Count() > 1