get list of running applications

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
adventuresofgreg
Posts: 349
Joined: Tue Oct 28, 2008 1:23 am
Contact:

get list of running applications

Post by adventuresofgreg »

Hey there:

Is there a windows shell command (or other command) that will return a list of the currently running applications? Specifically, I would like to get a list of which LC standalones that are currently running. My stack exports multiple versions of itself as standalones, then another stack launches each SA, 1 per core, then runs the program (processes data), and quits when finished. I need to monitor when the SA quits so that I can launch another SA - the idea is I want to always be using an available core. Any ideas?

Thanks!
Greg
stam
Posts: 3209
Joined: Sun Jun 04, 2006 9:39 pm

Re: get list of running applications

Post by stam »

Not sure on windows (the Mac way was discussed on the forums not so long ago I think).
Perhaps look here https://superuser.com/questions/914782/ ... in-windows ?
mrcoollion
Posts: 744
Joined: Thu Sep 11, 2014 1:49 pm

Re: get list of running applications

Post by mrcoollion »

The Windows tasklist command will return a list of currently running applications, including the process ID of each.

Example:
C:\> tasklist
This will return the list of running processes.
Example 2:
C:\> tasklist /fi "imagename eq notepad.exe"
This will return the list of running processes with the image name of "notepad.exe".

Here are all the windows tasklist command options. And an explainion of each option.

1. tasklist /v: Displays the list of tasks and additional information such as the memory usage, CPU time, startup time and the user name of each task.

2. tasklist /s: Displays the tasks on the specified remote computer.

3. tasklist /fi: Filters the tasks list using a given criteria.

4. tasklist /m: Displays the loaded modules for each task.

5. tasklist /svc: Displays the services used by each task.

6. tasklist /fo: Formats the output in the specified format.

7. tasklist /nh: Hides the list header.

8. tasklist /vhd: Displays the virtual memory size of each task.

9. tasklist /tr: Displays the full path of each task.

10. tasklist /sfi: Displays the list of tasks and additional information such as the image name, process ID, session ID and the number of threads used by each task

Regards,

Paul
adventuresofgreg
Posts: 349
Joined: Tue Oct 28, 2008 1:23 am
Contact:

Re: get list of running applications

Post by adventuresofgreg »

perfect! that works. Thanks!
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: get list of running applications

Post by FourthWorld »

Good to see you taking a break here from your travels, Greg.

Another thought: If the spawned instances connected with the launching app via sockets then the launcher would not only know about them, but could communicate with them, control them, pass them data as needed. And you'd always have them running, no need to quit when a given task is done and then relaunch for the next task.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: get list of running applications

Post by jacque »

Would the openProcesses function work? The clones would have to be started with "open process".
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
adventuresofgreg
Posts: 349
Joined: Tue Oct 28, 2008 1:23 am
Contact:

Re: get list of running applications

Post by adventuresofgreg »

Richard that's actually a really good suggestion, but I would still have to spawn these SA's because much of the processing rules for the data is contained in them, and that changes all the time.. unless I can pass the processing data to each one.. hmm.. thinking about that. Great suggestion.

Greg
FourthWorld wrote: Fri Jan 20, 2023 8:25 am Good to see you taking a break here from your travels, Greg.

Another thought: If the spawned instances connected with the launching app via sockets then the launcher would not only know about them, but could communicate with them, control them, pass them data as needed. And you'd always have them running, no need to quit when a given task is done and then relaunch for the next task.
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: get list of running applications

Post by FourthWorld »

If you wanna brainstorm any of this give me a call. It's always fun catching up with you. I'll tell you LC tales and you can tell me hiking tales.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Post Reply