Preventing multiple instances of a Windows app - still a problem

Mark Schonewille m.schonewille at
Sun Dec 4 18:30:32 EST 2011


What is the execution error exactly?! Please, always include the exact text of an error, whenever you write the word 'error'.

Kind regards,

Mark Schonewille

Share the clipboard of your computer over a local network with Clipboard Link

Op 5 dec. 2011 om 00:24 heeft Graham Samuel <livfoss at> het volgende geschreven:

> Finally, Mike gave me this little script in May - I tried to put it in a field and 'do' it as vbscript. Didn't works so then I put it in a text file, read it and tried do as vbscript again. Both times I got an execution error. Maybe it's just too late at night…
> 'sets the environment
> Set WshShell = WScript.CreateObject ("WScript.Shell")
> 'grabs the full processlist and puts it in a var
> Set colProcessList = GetObject("Winmgmts:").ExecQuery ("Select * from
> Win32_Process")
> 'loops through each looking for a match
> For Each objProcess in colProcessList
> If = "firefox.exe" then
> 'sets a flag if a match is found
> vFound = True
> End if
> 'next loop of course
> Next
> 'if a match was found, activate the app
> If vFound = True then
> WshShell.AppActivate "firefox"
> Else
> ' otherwise, run the app
> WshShell.Run "firefox.exe"
> End If

More information about the Use-livecode mailing list