Jump to content

how prevent multiple start of a UNIGUI-Exe?


Schlingel

Recommended Posts

Hi

 

Having another app that gets a list of running processes and takes your target exe as a parameter is one easy way to achieve this.

The attached code and compiled exe do just that.

 

the useage is 'launcher ExeToAttemptStart ParametersToExe'

 

e.g.

 

  launcher c:\myprojects\app1\myapp.exe "some list of parameters that are optional"

 

The included batch file 'runit.bat' tries to start notepad and open abc.txt - it will only open notepad if it's not already running.

 

The app uses shellexecute to start the target and makes no attempt to hide the parent process so there is potential to tidy it up!

Running launcher without any parameters simply opens the mainform with the option to view all running processes.

You can modify/ extend the function isrunning to include specific users and or paths rather than just the exe name. 

 

I found the original code here

  http://forum.codecall.net/topic/72604-getting-running-processes-list/

some years ago and have used it for a while without issue.

 

May be of some help?

 

Cheers

 

 

launcher.zip

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...