Preventing multiple instances of a Windows app - still a problem

Graham Samuel livfoss at mac.com
Wed Dec 7 08:49:58 EST 2011


Just to say that with a bit of work off-list, this issue was nailed for me by Mike Bonner (and thanks also to others who give info and suggestions).

Basically in Windows XP Home (and I hope in Windows 7 etc), tskill will kill a task, and qprocess will give a list of running tasks (thanks, Phil Davis). So it is possible to query if a particular task is running (via say matchtext on the output of qprocess), and then to kill it from within a LiveCode script if we want to, via shell. The other big insight for me, as being ignorant of Windows conventions, is that asterisk (*) acts as a wild-card character in commands like tskill, which gets thrown by spaces, so it's ok to write:

put shell("tskill troubling*app*)

and then the app with the space in its name gets recognised. You need the asterisk at the end of the name too, because sometimes '.exe' isn't recognised, don't ask me why.

Thanks again

Graham





More information about the use-livecode mailing list