Avoiding multiple instances of a running Rev app

Jim Bufalini jim at visitrieve.com
Thu Apr 30 10:13:34 EDT 2009

Paul Williams wrote:

> Richard,
> have at look at pv.exe
> http://makemsi-manual.dennisbareis.com/pv_exe.htm
> this is a small command that you can run as a shell and it then gives
> you a
> list of processes as well as the option to kill all or any of them.
> This works fine in all flavours of windows, what I do is copy pv.exe
> into a
> custom property, then extract it into the default directory, check for
> multiple
> processes with the name of my process then tidy up and close down.

Very nice Paul! I was going to suggest taskkill, but with that you have to
first identify that the process is running. This PV has both in one. Also,
since their docs didn't mention Vista, I tried it on Vista and not only did
it run, but even though it's an EXE, the firewall and Vista itself didn't
ask permission to allow it to run the first time! Interesting.

BTW Richard, on Windows you can also use reading and writing a flag to the
Windows registry that you app is running. When a second instance starts to
launch, it checks the flag and if it finds it, it quits. This can be error
prone, if your app is killed, so Paul's suggestion is better.

Paul, you wouldn't happen to have any other tidbits like this of truly free
utilities that you can distribute with your apps? Specifically something
like the browser cache view utilities from nirsoft:

The problem with nirsoft's is that while free, his licensing does not allow
commercial use or to distribute in any way with apps or to even charge money
for consulting using any of his utilities! The most ridiculous licensing
I've ever read. Shame, because he has really great utilities, not just for
browser but email and many other things. ;-)

Aloha from Hawaii,

Jim Bufalini

More information about the use-livecode mailing list